]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: deviceatlas: ignore not valuable HTTP request data
authorDavid Carlier <dcarlier@afilias.info>
Fri, 17 Nov 2017 08:47:25 +0000 (08:47 +0000)
committerWilly Tarreau <w@1wt.eu>
Fri, 17 Nov 2017 09:41:40 +0000 (10:41 +0100)
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.

src/da.c

index c31855d52f635523bad1a589383d99f56c60c163..09b0e3ec94c8b5ba2d61fb87c7979fa5cfff4c9a 100644 (file)
--- a/src/da.c
+++ b/src/da.c
@@ -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;
                }