]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: sample: Set the correct type when a binary is converted to a string
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 30 Apr 2020 07:57:40 +0000 (09:57 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 5 May 2020 09:06:43 +0000 (11:06 +0200)
A binary sample data can be converted, implicitly or not, to a string by cutting
the buffer on the first null byte.

I guess this patch should be backported to all stable versions.

src/sample.c

index 8bdbbe458dfd9e30d635787a6568eaed9edc995d..b9fe37f7f08b5f79c77ac78c820bb4bbaacf6a6d 100644 (file)
@@ -623,6 +623,7 @@ static int c_bin2str(struct sample *smp)
                        break;
                }
        }
+       smp->data.type = SMP_T_STR;
        return 1;
 }