alpine 3.6
obsolete weakness #286

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/xctrl.c

Context:

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

           c=*p;
        }
        break;
      }
      case '.':
        c=escaped?XK_Delete:*p;
        break;
      default:
      c=*p;
    }
    n=strchr(numkeys_upper,c);
    if (n) {
      c=numkeys_lower[n-numkeys_upper];
      ev.xkey.state|=ShiftMask;
    } else {
      if (escaped && (c>='0') && (c<='9') && (c!='5')) {
        c=navkeys[c-48];
      } else {
        ev.xkey.state|=isupper(c)?ShiftMask:0;
      }
    }
    ev.xkey.keycode=XKeysymToKeycode(disp,c);
    ev.xkey.type=KeyPress;
    XSendEvent(disp, win, True, KeyPressMask,&ev);
    usleep(1000);
    XSync(disp, False);
    ev.xkey.time=CurrentTime;
    ev.xkey.type=KeyRelease;
    XSendEvent(disp, win, True, KeyPressMask,&ev);
    usleep(1000);
    XSync(disp, False);
    ev.xkey.state=0;
    escaped=False;
  }
}

/*********************************************************************/
/* * * * * * * * * Clipboard and selection functions * * * * * * * * */
/*********************************************************************/
#include <X11/Xmu/Atoms.h>
/* xcout() contexts */
#define XCLIB_XCOUT_NONE  0  /* no context */
#define XCLIB_XCOUT_SENTCONVSEL  1  /* sent a request */
#define XCLIB_XCOUT_INCR  2  /* in an incr loop */
#define XCLIB_XCOUT_FALLBACK  3  /* UTF8_STRING failed, need fallback to XA_STRING */

/* xcin() contexts */
#define XCLIB_XCIN_NONE    0
#define XCLIB_XCIN_INCR    2
 

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.