diff options
author | Josh Triplett <josh@freedesktop.org> | 2007-03-10 11:10:42 -0800 |
---|---|---|
committer | Josh Triplett <josh@freedesktop.org> | 2007-03-10 11:11:32 -0800 |
commit | 3a4fdb5865f8ded10b51dc06631c30710d104a6c (patch) | |
tree | 1cc59671b80bf8d641bfad4154817e3d486abd70 /dissect.c | |
parent | Use GCC format and sentinel attributes on appropriate functions (diff) | |
download | sparse-3a4fdb5865f8ded10b51dc06631c30710d104a6c.tar.gz sparse-3a4fdb5865f8ded10b51dc06631c30710d104a6c.tar.bz2 sparse-3a4fdb5865f8ded10b51dc06631c30710d104a6c.zip |
Fix two potential NULL pointer dereferences in dissect.c
mk_name in dissect.c used ?: to check for NULL pointers in two arguments of an
snprintf call, but then just dereferenced the pointers in the other two parts
of the same call.
Thanks to Florian Krohm of IBM for reporting the problem.
Signed-off-by: Josh Triplett <josh@freedesktop.org>
Diffstat (limited to 'dissect.c')
-rw-r--r-- | dissect.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -179,8 +179,8 @@ static inline struct ident *mk_name(struct ident *root, struct ident *node) char name[256]; snprintf(name, sizeof(name), "%.*s:%.*s", - root ? root->len : 0, root->name, - node ? node->len : 0, node->name); + root ? root->len : 0, root ? root->name : "", + node ? node->len : 0, node ? node->name : ""); return built_in_ident(name); } |