Age | Commit message (Collapse) | Author |
|
Fixes numerous gcc warnings of the form:
connect.c: In function ‘IceOpenConnection’:
ICElibint.h:160:25: warning: potential null pointer dereference [-Wnull-dereference]
*((CARD16 *) _pBuf) = _val; \
^
ICElibint.h:174:5: note: in expansion of macro ‘STORE_CARD16’
STORE_CARD16 (_pBuf, _len); \
^~~~~~~~~~~~
connect.c:351:5: note: in expansion of macro ‘STORE_STRING’
STORE_STRING (pData, IceReleaseString);
^~~~~~~~~~~~
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Fixes gcc complaint:
process.c: In function ‘ProcessAuthReply’:
process.c:1478:20: warning: declaration of ‘status’ shadows a previous local [-Wshadow]
1478 | Status status = 1;
| ^~~~~~
process.c:1426:25: note: shadowed declaration is here
1426 | IcePaAuthStatus status =
| ^~~~~~
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Found by using:
codespell --builtin clear,rare,usage,informal,code,names
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Assigning and testing a value in a single statement hinders code clarity
and may confuses static code analyzers.
Separate the assignment and the test for clarity.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
|
free() can handle NULL just fine - remove the check.
Signed-off-by: Walter Harms <wharms@bfs.de>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
|
|
`error_message` is passed in to strncpy() without any check, which
doesn't handle NULL itself, so let's make it a valid empty string in
cases where it was NULL.
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Acked-by: Walter Harms <wharms@bfs.de>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
|
|
Similar to the previous commit, assigning a static string would crash
upon freeing.
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Acked-by: Walter Harms <wharms@bfs.de>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
|
|
If the `errorClass` isn't handled by the switch, `errorStr`'s initial
value would be a pointer to some static memory with an empty string,
and freeing it would most likely crash.
Let's set it to NULL instead, as is done in other similar places.
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Acked-by: Walter Harms <wharms@bfs.de>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
|
|
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (IRC)
|
|
https://bugs.freedesktop.org/show_bug.cgi?id=90616
Recent versions of gcc have array bounds checking turned on by default,
this leads to build failures of libICE. As the _IceVersionCount variable
in ICElibint.h is not declared const the compiler cannot assume that the
nested for loop in ProcessConnectionSetup stays within bounds.
The simple fix is of course to change the declarations of _IceVersionCount,
_IceVersions, and the local variable myVersionCount to const declarations.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
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>
|
|
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>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
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>
|
|
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>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
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>
|
|
Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
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
|
|
make _IceProcessCoreMessage and default error handlers static
|
|
|
|
subprotocol. (016_ICE_subprotocol_reply_fix.diff from Debian, by Jochen
Voss)
|
|
- Add ICE to symlink.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|