projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
06b8201
)
Fix potential segfault in the replacement vasprintf() function.
author
Guus Sliepen
<guus@tinc-vpn.org>
Tue, 31 Jan 2017 11:03:27 +0000
(12:03 +0100)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Tue, 31 Jan 2017 11:03:27 +0000
(12:03 +0100)
src/dropin.c
patch
|
blob
|
history
diff --git
a/src/dropin.c
b/src/dropin.c
index
c7b558a
..
a4f7a65
100644
(file)
--- a/
src/dropin.c
+++ b/
src/dropin.c
@@
-106,14
+106,13
@@
int vasprintf(char **buf, const char *fmt, va_list ap) {
va_copy(aq, ap);
status = vsnprintf(*buf, len, fmt, aq);
- buf[len - 1] = 0;
va_end(aq);
if(status >= 0)
*buf = xrealloc(*buf, status + 1);
if(status > len - 1) {
- len = status;
+ len = status
+ 1
;
va_copy(aq, ap);
status = vsnprintf(*buf, len, fmt, aq);
va_end(aq);