HI all,

another patch to fix an use case when the attended HTTP header by the
convertor is not found, either by Haproxy req*del modifiers or even just
the web browser, hence avoiding a segfault.

Please cc [email protected] for any answer.

Kindest regards.
From a844dab9eb961c46a3ceb5855bf710f98c3ec848 Mon Sep 17 00:00:00 2001
From: David Carlier <[email protected]>
Date: Wed, 2 Dec 2015 12:05:42 +0000
Subject: [PATCH] BUG/MEDIUM: da: stop DeviceAtlas processing in the convertor
 if there is no input.

In case a HTTP header modifier, like req*del, is used, the User-Agent would be removed
and cause a segfault, hence the work is stopped in due time.
---
 src/da.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/da.c b/src/da.c
index e1886b8..a214b31 100644
--- a/src/da.c
+++ b/src/da.c
@@ -232,7 +232,7 @@ static int da_haproxy_conv(const struct arg *args, struct sample *smp, void *pri
 	char useragentbuf[1024] = { 0 };
 	int i;
 
-	if (global.deviceatlas.daset == 0) {
+	if (global.deviceatlas.daset == 0 || smp->data.u.str.len == 0) {
 		return 1;
 	}
 
-- 
2.1.4

Reply via email to