summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2013-12-24Delete unused name variable in register.cAlan Coopersmith
Found by cppcheck 1.62: [src/register.c:84]: (style) Variable 'name' is assigned a value that is never used. [src/register.c:182]: (style) Variable 'name' is assigned a value that is never used. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-12-24Free iceConn->connection_string when unwinding after malloc failsAlan Coopersmith
Found by cppcheck 1.62: [src/accept.c:113]: (error) Memory leak: iceConn.connection_string Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-09-12Use arc4random when available to produce the auth cookie.Matthieu Herrb
arc4random() and associated functions can be found in libbsd on GNU/Linux systems. Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-08Make STORE_STRING cast strlen result to CARD16 when storing in CARD16Alan Coopersmith
Clears a number of clang warnings of the form: connect.c:328:6: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'CARD16' (aka 'unsigned short') [-Wconversion] STORE_STRING (pData, _IceAuthNames[i]); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./ICElibint.h:173:19: note: expanded from macro 'STORE_STRING' CARD16 _len = strlen (_string); \ ~~~~ ^~~~~~~~~~~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-08Make write_string call write_counted_string instead of copying itAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-08Mark input arguments to write_string functions as constAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-08Stop casting return values from mallocAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-08Get rid of casts to (char *) in calls to free()Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-20Convert remaining sprintf() call to snprintf()Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-20Convert strcpy/strcat pairs to snprintf callsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-20Fix some clang warnings about integer sign/size conversionsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-20unifdef WORD64Alan Coopersmith
Remove leftover remnants of CRAY support, which still had some functions consisting solely of /* NOT IMPLEMENTED YET */ comments. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-20Constify filename argument to IceLockAuthFile & IceUnlockAuthFileAlan Coopersmith
Needed to fix const string warnings in iceauth - functions already copy provided arguments to temporary local buffer for modifications. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-01-04unifdef -U__UNIXOS2__Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-11-30Plug minor memory leak in unusual path through ProcessConnectionSetupAlan Coopersmith
Error: Memory leak (CWE 401) Memory leak of pointer 'release' allocated with malloc((_len + 1)) at line 1100 of src/process.c in function 'ProcessConnectionSetup'. 'release' allocated at line 920 with malloc((_len + 1)). release leaks when _i >= hisAuthCount at line 925 and i >= _IceAuthCount at line 973 and found != 0 at line 998 and status != 0 at line 1053 and status != 1 at line 1070 and accept_setup_now == 0 at line 1082 and i >= hisAuthCount at line 1093. Memory leak of pointer 'vendor' allocated with malloc((_len + 1)) at line 1100 of src/process.c in function 'ProcessConnectionSetup'. 'vendor' allocated at line 919 with malloc((_len + 1)). vendor leaks when _i >= hisAuthCount at line 925 and i >= _IceAuthCount at line 973 and found != 0 at line 998 and status != 0 at line 1053 and status != 1 at line 1070 and accept_setup_now == 0 at line 1082 and i >= hisAuthCount at line 1093. [ This bug was found by the Parfait 0.3.7 bug checking tool. For more information see http://labs.oracle.com/projects/parfait/ ] Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-22Constify protocol, vendor & release string args to IceRegisterForProtocol*Alan Coopersmith
Needed to resolve gcc -Wwrite-strings warnings in callers. These functions only pass the strings to strcmp before calling strdup to make their own private copy for storing away. While fixing the API docs to match, also fix them to match the existing function prototypes, where there were several errors before (including just plain missing most of the args to IceRegisterForProtocolReply). Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-11Remove ancient workaround for System V/386 Release 4.2 compiler bugAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr> Reviewed-by: walter <wharms@bfs.de> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-11Fix gcc -Wwrite-strings warnings in process.cAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-11Fix gcc -Wwrite-strings warnings in AuthNames handlingAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-11constify arguments to IceGetAuthFileEntryAlan Coopersmith
Needed to clear gcc -Wwrite-strings warnings in callers Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-11Fix gcc -Wwrite-strings warnings in _IceError* functionsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-11Fix gcc -Wwrite-strings warnings in _IceDefaultErrorHandlerAlan Coopersmith
Had to split char *str into two variables, const char *str for the string literals just being passed to fprintf etal. and char *estr for use by EXTRACT_STRING for the results of malloc calls that get written to and then freed. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-09-16Strip trailing whitespaceAlan Coopersmith
Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}' git diff -w & git diff -b show no diffs from this change Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-21Fix reads outside array bounds in error handlersAlan Coopersmith
Error: Buffer overrun Read outside array bounds (CWE 125): In call to memcpy(<unknown>, &mOp, 8), (size(&mOp) < (unsigned) 8) Array size is 1 bytes at line 296 of src/error.c in function '_IceErrorMajorOpcodeDuplicate'. Error: Buffer overrun Read outside array bounds (CWE 125): In call to memcpy(<unknown>, &maj, 8), (size(&maj) < (unsigned) 8) Array size is 1 bytes at line 346 of src/error.c in function '_IceErrorBadMajor'. [ This bug was found by the Parfait 0.3.7 bug checking tool. For more information see http://labs.oracle.com/projects/parfait/ ] Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-02-02config: splitting ICE and XTRANS compiler options is not requiredGaetan Nadon
Simplify configuration by using a single PKG_CHECK_MODULES statement. Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2011-01-07Resync fallback asprintf with updated version put into xrdbAlan Coopersmith
Fixes issues found during xrdb review on xorg-devel Also make sure <stdarg.h> is #included for varargs macros Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-12-19Use correct string pointer in asprintf() fallbackAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-12-13Convert src/process.c from malloc + sprintf to asprintfAlan Coopersmith
Includes simple local implemenation of asprintf if configure doesn't find one in system libraries Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-10-17Fix include ordering, so -I../include precedes $CPPFLAGS which couldJeremy Huddleston
cause us to include installed rather than packaged headers. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-10-06Purge cvs tags.Jesse Adkins
Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-05-11Set the close-on-exec flag for listening socketsJulien Cristau
This prevents xsm from leaking file descriptors to the processes it starts. X.Org bug#22932 <http://bugs.freedesktop.org/show_bug.cgi?id=22932> Reported-by: Kalle Olavi Niemitalo <kon@iki.fi> Signed-off-by: Julien Cristau <jcristau@debian.org>
2010-02-16config: move CWARNFLAGS from configure.ac to Makefile.amGaetan Nadon
Compiler warning flags should be explicitly set in the makefile rather than being merged with other packages compiler flags. Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2009-01-28Janitor: Correct sparse warnings.Paulo Cesar Pereira de Andrade
Also reorders some code in configure.ac and Makefile.am to match pattern used on other packages.
2009-01-06use memcmp instead of binaryEqualPeter Breitenlohner
suggested by Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> http://lists.freedesktop.org/archives/xorg/2008-December/041222.html
2009-01-06Use NULL, not zero, for pointersPeter Breitenlohner
From Magnus Kessler <Magnus.Kessler@gmx.net> http://lists.freedesktop.org/archives/xorg/2008-October/039799.html http://lists.freedesktop.org/archives/xorg/attachments/20081030/b2ea5b1c/attachment-0001.bin
2009-01-06ANSI CPeter Breitenlohner
convert all old style function declarations see also: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> http://bugs.freedesktop.org/show_bug.cgi?id=14683 http://bugs.freedesktop.org/attachment.cgi?id=14582 see also: Magnus Kessler <Magnus.Kessler@gmx.net> http://lists.freedesktop.org/archives/xorg/2008-October/039799.html http://lists.freedesktop.org/archives/xorg/attachments/20081030/b2ea5b1c/attachment-0001.bin
2009-01-06towards ANSI CPeter Breitenlohner
make _IceProcessCoreMessage and default error handlers static
2009-01-06Activate CWARNFLAGS with lots of gcc warningsPeter Breitenlohner
2008-10-07Constify some arguments in libICE to clear warnings in libSMPeter Breitenlohner
This patch avoids the gcc (3.4.6) warnings: ../../libSM-1.0.3/src/sm_client.c:104: warning: passing arg 7 of `IceRegisterForProtocolSetup' from incompatible pointer type ../../libSM-1.0.3/src/sm_manager.c:168: warning: passing arg 7 of `IceRegisterForProtocolReply' from incompatible pointer type when compiling libSM
2008-10-07define macros to 1 in icetrans.c to avoid redefined macro warningsPeter Breitenlohner
X.Org Bug #17947 <http://bugs.freedesktop.org/show_bug.cgi?id=17947> Patch #19444 <http://bugs.freedesktop.org/attachment.cgi?id=19444> Define as 1 (one) as done by autoconf and the command line option, e.g. -DICE_t, not as empty. This avoids the gcc (3.4.6) warnings: ../../libICE-1.0.4/src/icetrans.c:29:1: warning: "ICE_t" redefined ../config.h:38:1: warning: this is the location of the previous definition ../../libICE-1.0.4/src/icetrans.c:30:1: warning: "TRANS_CLIENT" redefined <command line>:6:1: warning: this is the location of the previous definition ../../libICE-1.0.4/src/icetrans.c:31:1: warning: "TRANS_SERVER" redefined <command line>:7:1: warning: this is the location of the previous definition
2008-04-29silence warningAlan Hourihane
2008-04-29include for sleep()Colin Harrison
2008-03-09nuke RCS IdsMatthieu Herrb
2007-06-04Add $(AM_CFLAGS) to lint flags to get correct Xtrans flagsAlan Coopersmith
2007-04-05Replace many malloc(strlen()); strcpy() pairs with strdup()Alan Coopersmith
2007-04-05Provide ANSI C prototypes for more static functionsAlan Coopersmith
2007-04-05Convert authutil.c static helpers to ANSI C prototypes to clear sparse warningsAlan Coopersmith
2007-04-05Add hooks for checking source code with lint/sparse/etc.Alan Coopersmith
2007-04-05Coverity #1086: Double free of pointer "*listenObjsRet"Alan Coopersmith
Same bug, different function.
2007-04-05Coverity #1085: Double free of pointer "*listenObjsRet"Alan Coopersmith
If malloc failed in the loop in IceListenForConnections, the error path would free all previous allocations, then loop around and try again, and if it failed again, free the previous allocations again. On the other hand, if it succeeded on the later tries, then the memory would just be leaked, since the error would be returned and not the pointer to them.