• Alan Coopersmith's avatar
    xlibi18n: fix argsize argument to _XlcParsePath · 5d6cda4f
    Alan Coopersmith authored
    The array is defined as having NUM_LOCALEDIR entries, so use that
    instead of hardcoded 256 value (the other two calls already did this).
    
    Reported by parfait:
       Buffer overflow (CWE 120): In pointer dereference of argv[argc] with index argc
          Pointer size is 64 elements (of 8 bytes each), index is 255
            at line 82 of nx-X11/lib/X11/lcFile.c in function 'parse_line'.
            called at line 178 in function '_XlcParsePath' with argv = argv.
            called at line 722 in function '_XlcLocaleLibDirName' with argv = args, argsize = 256.
            at line 82 of nx-X11/lib/X11/lcFile.c in function 'parse_line'.
            called at line 178 in function '_XlcParsePath' with argv = argv.
            called at line 638 in function '_XlcLocaleDirName' with argv = args, argsize = 256.
    
    [ This bug was found by the Parfait 1.2.0 bug checking tool.
      http://labs.oracle.com/pls/apex/f?p=labs:49:::::P49_PROJECT_ID:13 ]
    Signed-off-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
    Backported-to-NX-by: 's avatarUlrich Sibiller <uli42@gmx.de>
    5d6cda4f
lcFile.c 17 KB