projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9f1354b
)
write_sensu plugin: use the right size for buffer
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Mon, 14 May 2018 20:08:35 +0000
(22:08 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Mon, 14 May 2018 20:08:35 +0000
(22:08 +0200)
I missed that r is a pointer, not an array.
Fixes CID #185580
src/write_sensu.c
patch
|
blob
|
history
diff --git
a/src/write_sensu.c
b/src/write_sensu.c
index
cf6a6bd
..
bda3327
100644
(file)
--- a/
src/write_sensu.c
+++ b/
src/write_sensu.c
@@
-626,7
+626,7
@@
static char *replace_str(const char *str, const char *old, /* {{{ */
r += newlen;
p = q + oldlen;
}
- sstrncpy(r, p,
sizeof(r)
);
+ sstrncpy(r, p,
retlen + 1
);
return ret;
} /* }}} char *replace_str */