alpine 3.8
obsolete weakness #23

1

Weakness Breakdown


Definition:

An obsolete weakness occurs when someone uses deprecated or obsolete functions when building a system. As a programming language evolves, some functions occasionally become obsolete.

Warning code(s):

This C routine is considered obsolete.

File Name:

lua-xctrl/src/xctrl-2015.04.10/src/lxctrl.c

Context:

The highlighted line of code below is the trigger point of this particular Alpine 3.8 obsolete weakness.

   const char*src,*from_charset,*to_charset;
  char*dst;
  lwmc_check_obj(L);
  src=luaL_checkstring(L,2);
  from_charset=luaL_checkstring(L,3);
  to_charset=luaL_checkstring(L,4);
  dst=convert_locale(src,from_charset,to_charset);
  if (dst) {
    lua_pushstring(L,dst);
    free(dst);
    return 1;
  } else {
    return 0;
  }
}



static int lwmc_do_events(lua_State*L)
{
  XCtrl*ud=lwmc_check_obj(L);
  int n=luaL_optnumber(L,2,1);
  int i;
  for (i=0; i<n; i++) {
    usleep(100000);
    XSync(ud->dpy,False);
  }
  return 0;
}


static int lwmc_get_selection(lua_State*L)
{
  XCtrl*ud=lwmc_check_obj(L);
  const char*kind=luaL_optstring(L,2,"p");
  Bool utf8=lua_gettop(L)>2?lua_toboolean(L,3):False;
  uchar*sel=get_selection(ud->dpy, kind[0], utf8);
  if (sel) {
    lua_pushstring(L, (char*)sel);
    free(sel);
    return 1;
  }
  return 0;
}



static int lwmc_set_selection(lua_State*L)
{
  XCtrl*ud=lwmc_check_obj(L); 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.