summaryrefslogtreecommitdiff
path: root/process.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix spelling/wording issuesAlan Coopersmith2021-11-281-3/+3
| | | | | | | Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Fix segmentation fault on invalid input.Tobias Stoeckmann2018-03-241-2/+4
| | | | | | | | | | | | | | | | | | The 'add' command leads to a segmentation fault on invalid input. Two arguments to 'add' can be quoted, but the quotation check does not properly parse a single double quote: $ echo 'add 0 " 0 0 0' | iceauth Segmentation fault $ _ This happens because the code does not properly check if the argument consists of just one quote. Technically, it is true that the first and the last characters are double quotes. Therefore it also takes a check to verify that the length of the string is at least 2. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* More constification cleanupAlan Coopersmith2014-05-311-36/+37
| | | | | | | | | | | | | | Started by fixing gcc warning: iceauth.c:47:1: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default] static char *defcmds[] = { "source", "-", NULL }; /* default command */ ^ and chasing down the rabbit hole of the functions the command line arguments can be passed through, until we came out the other side const clean. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Free old argv array if realloc fails to enlarge itAlan Coopersmith2013-12-091-1/+5
| | | | | | | | | Found by cppcheck: [app/iceauth/process.c:302]: (error) Common realloc mistake: 'argv' nulled but not freed upon failure Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
* Fix "noexistent" typo in error messageAlan Coopersmith2013-11-221-1/+1
| | | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
* Constify some more string pointers to fix gcc warningsAlan Coopersmith2013-07-171-15/+16
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Use void * instead of char * for generic pointer arg to DoFunc functionsAlan Coopersmith2013-07-171-13/+13
| | | | | | | | | | | | | | | | | | Quiets clang warnings of: process.c:754:29: warning: cast from 'char *' to 'struct _list_data *' increases required alignment from 1 to 8 [-Wcast-align] struct _list_data *ld = (struct _list_data *) data; ^~~~~~~~~~~~~~~~~~~~~~~~~~ process.c:787:32: warning: cast from 'char *' to 'struct _extract_data *' increases required alignment from 1 to 8 [-Wcast-align] struct _extract_data *ed = (struct _extract_data *) data; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ process.c:988:22: warning: cast from 'char *' to 'int *' increases required alignment from 1 to 4 [-Wcast-align] int *nremovedp = (int *) data; ^~~~~~~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Mark unused arguments in callback functions to quiet clang warningsAlan Coopersmith2013-07-171-17/+17
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Fix some sign/size conversion warnings from clangAlan Coopersmith2013-07-171-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | process.c:410:22: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] retval = malloc (len); ~~~~~~ ^~~ process.c:454:30: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] strncmp (cmd, ct->name, n) == 0) { ~~~~~~~ ^ process.c:450:9: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32] n = strlen (cmd); ~ ^~~~~~~~~~~~ process.c:1028:34: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] if (strncmp (cmd, ct->name, len) == 0) { ~~~~~~~ ^~~ process.c:1026:12: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32] int len = strlen (cmd); ~~~ ^~~~~~~~~~~~ process.c:1560:8: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32] len = strlen (buf); ~ ^~~~~~~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Add _X_NORETURN attributes suggested by gccAlan Coopersmith2013-02-231-2/+2
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Assume signal handlers return void, as C89 requiresAlan Coopersmith2013-02-231-18/+2
| | | | | | | Drops use of autoconf's obsolete AC_TYPE_SIGNAL and Imake's even more obsolete SIGNALRETURNSINT. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* auth_finalize: Attempt to rename() if link() failsJeremy Huddleston2011-05-231-1/+2
| | | | | | | | On some file systems (like AFP), hard links are not supported. If link fails, try rename() before giving up. Reported-by: Jamie Kennea <jamie@pompey.org> Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
* Error out and avoid a call to malloc(0) if given a bad hex stringJeremy Huddleston2011-04-281-2/+2
| | | | | Found-by: clang static analyzer Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
* Purge cvs tags.Jesse Adkins2010-10-061-4/+0
| | | | Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com>
* Constify some static data constantsAlan Coopersmith2007-05-171-10/+10
|
* ANSIfy function declarationsAlan Coopersmith2007-05-171-165/+155
|
* Fix some lint warningsAlan Coopersmith2007-05-171-5/+10
| | | | | | (611) warning: assignment of 64-bit integer to 32-bit integer (653) warning: variable argument to strcpy(); make sure it's safe (728) warning: sign extension from 32-bit to 64-bit integer
* Bug 10739: iceauth dumps core if signal caught before initialization doneAlan Coopersmith2007-05-161-4/+3
| | | | | | | | | X.Org Bugzilla #10739 <http://bugs.freedesktop.org/show_bug.cgi?id=10739> Adding a test for NULL filename before calling IceUnlockAuthFile in auth_finalize cleared the crash, but left the lock file behind. Moving the initialization of authfilename to earlier in auth_initialize() allowed the locks to be cleaned up as well.
* Replace copystring() with strdup() callsAlan Coopersmith2007-05-141-13/+1
| | | | | Also solves Coverity #924: Function copystring: Pointer "src" dereferenced before NULL check
* Coverity #1089: Double frees in error cleanup pathAlan Coopersmith2007-05-141-4/+4
| | | | | Double free of pointer "(auth)->auth_data" in call to "free" Double free of pointer "(auth)->protocol_data" in call to "free"
* Coverity #1039: Using uninitialized value "authdata"Alan Coopersmith2007-05-141-1/+1
|
* Add config.h includes for modularization Use RETSIGTYPE if defined byXORG-6_8_99_903XORG-6_8_99_902XORG-6_8_99_901XORG-6_8_99_900Alan Coopersmith2005-07-261-0/+4
| | | | | | autoconf in addition to Imake's SIGNALRETURNSINT. Use HAVE_WORKING_VFORK if defined by autoconf in addition to Imake's HAS_VFORK
* Mark variables modified in signal handlers as volatile (part of Sun bug idXORG-6_8_99_16Alan Coopersmith2005-07-161-2/+2
| | | | 4496504)
* Merging XORG-CURRENT into trunksco_port_update-baserel-0-6-1lg3d-rel-0-7-0lg3d-rel-0-6-2lg3d-baseXORG-6_8_99_9XORG-6_8_99_8XORG-6_8_99_7XORG-6_8_99_6XORG-6_8_99_5XORG-6_8_99_4XORG-6_8_99_3XORG-6_8_99_2XORG-6_8_99_15XORG-6_8_99_14XORG-6_8_99_13XORG-6_8_99_12XORG-6_8_99_11XORG-6_8_99_10XORG-6_8_99_1XORG-6_8_2XORG-6_8_1_904XORG-6_8_1_903XORG-6_8_1_902XORG-6_8_1_901XORG-6_8_1XORG-6_8_0XORG-6_7_99_904XORG-6_7_99_903XORG-6_7_99_902XORG-6_7_99_901XORG-6_7_99_2XORG-6_7_99_1XACE-SELINUX-MERGEsco_port_updatelg3d-masterlg3d-eventlg3d-dev-0-7-1lg3d-dev-0-7-0lg3d-dev-0-6-latestlg3d-dev-0-6-2lg3d-dev-0-6-1-latestlg3d-dev-0-6-1-currentlg3d-dev-0-6-1-1lg3d-dev-0-6-1lg3dXORG-6_8-branchCOMPOSITEWRAPEgbert Eich2004-04-231-1/+1
|
* Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004xf86-4_4_99_1Egbert Eich2004-03-141-1/+1
|
* Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004xf86-4_4_0STSF-CURRENTEgbert Eich2004-03-031-1/+1
|
* readding XFree86's cvs IDsxf86-4_3_99_903Egbert Eich2004-02-261-1/+1
|
* Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004Egbert Eich2004-02-261-1/+1
|
* XFree86 4.3.0.1xf86-4_3_99_903_specialxf86-4_3_99_902xf86-4_3_99_901xf86-4_3_99_16xf86-4_3_0_1xf86-012804-2330PRE_xf86-4_3_0_1Kaleb Keithley2003-11-141-15/+71
|
* R6.6 is the Xorg base-lineXORG-MAINXORG-STABLEKaleb Keithley2003-11-141-0/+1562