projects
/
haproxy-3.0.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cdade94
)
BUG/MINOR: sendmail: The return of vsnprintf is not cleanly tested
author
Thierry FOURNIER
<thierry.fournier@ozon.io>
Thu, 9 Feb 2017 11:19:27 +0000
(12:19 +0100)
committer
Willy Tarreau
<w@1wt.eu>
Fri, 10 Feb 2017 05:18:17 +0000
(06:18 +0100)
The string formatted by vsnprintf may be bigger than the size of
the buffer "buf". This case is not tested.
This sould be backported to 1.6 and 1.7
src/checks.c
patch
|
blob
|
history
diff --git
a/src/checks.c
b/src/checks.c
index
7d42422
..
49bd886
100644
(file)
--- a/
src/checks.c
+++ b/
src/checks.c
@@
-3398,7
+3398,7
@@
void send_email_alert(struct server *s, int level, const char *format, ...)
len = vsnprintf(buf, sizeof(buf), format, argp);
va_end(argp);
- if (len < 0) {
+ if (len < 0 || len >= sizeof(buf)) {
Alert("Email alert [%s] could not format message\n", p->id);
return;
}