Repositories
/
olsrd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
167935c
)
info: protect skipLeadingWhitespace against invalid input and zero length
author
Ferry Huberts
<ferry.huberts@pelagic.nl>
Wed, 7 Dec 2016 23:12:37 +0000
(
00:12
+0100)
committer
Ferry Huberts
<ferry.huberts@pelagic.nl>
Wed, 4 Jan 2017 08:47:10 +0000
(09:47 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/info/olsrd_info.c
patch
|
blob
|
history
diff --git
a/lib/info/olsrd_info.c
b/lib/info/olsrd_info.c
index
5dfa62f
..
fc1597a
100644
(file)
--- a/
lib/info/olsrd_info.c
+++ b/
lib/info/olsrd_info.c
@@
-582,6
+582,10
@@
static void send_info(const char * req, unsigned int send_what, int the_socket,
}
static char * skipLeadingWhitespace(char * requ, size_t *len) {
+ if (!requ || !len || !*len) {
+ return requ;
+ }
+
while (isspace(*requ) && (*requ != '\0')) {
*len = *len - 1;
requ++;