BUG/MINOR: spoa-example: unexpected behavior for more than 127 args
Buf is unsigned, so nbargs will be negative for more then 127 args.
Note that I cant test this bug because I cant put sufficient args
on the configuration line. It is just detected reading code.
[wt: this can be backported to 1.8 & 1.7]
diff --git a/contrib/spoa_example/spoa.c b/contrib/spoa_example/spoa.c
index 026f256..bf2dbe9 100644
--- a/contrib/spoa_example/spoa.c
+++ b/contrib/spoa_example/spoa.c
@@ -1318,7 +1318,7 @@
DEBUG(frame->worker, "Process SPOE Message '%.*s'", (int)sz, str);
- nbargs = *p++; /* Get the number of arguments */
+ nbargs = (unsigned char)*p++; /* Get the number of arguments */
frame->offset = (p - frame->buf); /* Save index to handle errors and skip args */
if (!memcmp(str, "check-client-ip", sz)) {
union spoe_data data;