BUG/MEDIUM: deviceatlas: ignore not valuable HTTP request data

A customer reported a crash when within the HTTP request some headers
were not set leading to the module to crash. So the module ignore them
since empty data have no value for the detection.
Needs to be backported to 1.7.
This commit is contained in:
David Carlier 2017-11-17 08:47:25 +00:00 committed by Willy Tarreau
parent e9bed53486
commit 91a88b0c25

View File

@ -318,7 +318,7 @@ static int da_haproxy_fetch(const struct arg *args, struct sample *smp, const ch
char hbuf[24] = { 0 };
/* The HTTP headers used by the DeviceAtlas API are not longer */
if (hctx.del >= sizeof(hbuf)) {
if (hctx.del >= sizeof(hbuf) || hctx.del <= 0 || hctx.vlen <= 0) {
continue;
}