Age | Commit message (Collapse) | Author |
|
Instead of sprintf()'ing a 4 character string to a char [4] buffer,
and leaving the trailing '\0' to overwrite into the next entry,
snprintf() to a 5 character temp buffer and memcpy the 4 characters
to the right place.
Fixes parfait errors:
Error: Buffer overflow at xkbcomp-1.0.4/misc.c:393
in function 'ComputeKbdDefaults' [Standard C Library pattern matching]
In sprintf related dereference of xkb->names->keys[i].name
with index not less than '4'
Destination array size is 4 bytes, data to be written is 4 bytes
Error: Buffer overflow at xkbcomp-1.0.4/misc.c:402
in function 'ComputeKbdDefaults' [Standard C Library pattern matching]
In sprintf related dereference of xkb->names->keys[i].name
with index not less than '4'
Destination array size is 4 bytes, data to be written is 4 bytes
[This bug was found by the Parfait bug checking tool.
For more information see http://research.sun.com/projects/parfait ]
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
|
|
Remaining warnings are due to macros that check address or vectors
on the stack and auto generated yacc code.
Compiled with default flags and also as:
% make CFLAGS=-DENTRY_TRACKING_ON -DDEBUG_ON -DASSERTIONS_ON
to ensure the "simplification" of code like:
foo.c:
<hash>define DEBUG_VAR foo_VAR
<hash>include "foo.h"
...
foo.h:
<hash>ifdef DEBUG_VAR_NOT_LOCAL
extern
<hash>endif
int DEBUG_VAR;
...
did not change the author's "intended" logic.
|
|
|
|
"Conditional jump or move depends on uninitialised value(s)"
|
|
|
|
indent -cbi 0 -nprs -nut -npcs -i4 -bli 0 *.c *.h
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|