projects
/
framework
/
security
/
smack.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c789367
)
libsmack: fixed segfault in get_label() (regression in 66483b)
author
Rafal Krypa
<r.krypa@samsung.com>
Fri, 29 Nov 2013 19:42:25 +0000
(20:42 +0100)
committer
Rafal Krypa
<r.krypa@samsung.com>
Fri, 29 Nov 2013 19:42:25 +0000
(20:42 +0100)
Commit 66483b introduced segfault in API functions smack_revoke_subject()
and smack_set_label_for_self().
Fix the accidental NULL pointer dereference.
libsmack/libsmack.c
patch
|
blob
|
history
diff --git
a/libsmack/libsmack.c
b/libsmack/libsmack.c
index
28c2715
..
32f1be3
100644
(file)
--- a/
libsmack/libsmack.c
+++ b/
libsmack/libsmack.c
@@
-740,7
+740,7
@@
static inline ssize_t get_label(char *dest, const char *src)
dest[i] = src[i];
}
- if (i < (SMACK_LABEL_LEN + 1))
+ if (
dest &&
i < (SMACK_LABEL_LEN + 1))
dest[i] = '\0';
return i < (SMACK_LABEL_LEN + 1) ? i : -1;