Hi,

Here a patch to fix a potential crash in the deviceatlas module due to a
customer report.
Needs to be backported into the 1.7 branch.

Thanks in advance.

Kindest regards.
From 537c91a8f20922001d5f2a857ec0adb3b57547bf Mon Sep 17 00:00:00 2001
From: David Carlier <dcarl...@afilias.info>
Date: Fri, 17 Nov 2017 08:47:25 +0000
Subject: [PATCH] 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.
---
 src/da.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/da.c b/src/da.c
index c31855d..09b0e3e 100644
--- 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;
 		}
 
-- 
2.7.4

Reply via email to