Repositories
/
olsrd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
763a629
)
info: protect stripTrailingSlashes against invalid input and zero length
author
Ferry Huberts
<ferry.huberts@pelagic.nl>
Thu, 8 Dec 2016 07:49:08 +0000
(08:49 +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
fc1597a
..
e956866
100644
(file)
--- a/
lib/info/olsrd_info.c
+++ b/
lib/info/olsrd_info.c
@@
-606,6
+606,10
@@
static char * stripEOLs(char * requ, size_t *len) {
}
static char * stripTrailingSlashes(char * requ, size_t *len) {
+ if (!requ || !len || !*len) {
+ return requ;
+ }
+
while ((requ[*len - 1] == '/') && (requ[*len - 1] != '\0')) {
*len = *len - 1;
requ[*len] = '\0';