This diff should be superfluous with the next diff, but I don't think
this should be left as is anyway.

It's not a big problem, since it's a static buffer and it gets
initialized by previous calls, so it's always NUL-terminated, but
it's not accurate.

OK?

martijn@

Index: ax.c
===================================================================
RCS file: /cvs/src/lib/libagentx/ax.c,v
retrieving revision 1.7
diff -u -p -r1.7 ax.c
--- ax.c        2 Jan 2021 01:06:31 -0000       1.7
+++ ax.c        24 Oct 2021 17:31:03 -0000
@@ -764,6 +764,8 @@ ax_oidrange2string(struct ax_oid *oid, u
 
        rest = sizeof(buf);
        p = buf;
+       if (oid->aoi_idlen == 0)
+               (void)strlcpy(buf, "null", sizeof(buf));
        for (i = 0; i < oid->aoi_idlen; i++) {
                if (range_subid != 0 && range_subid - 1 == (uint8_t)i)
                        ret = snprintf(p, rest, ".[%u-%u]", oid->aoi_id[i],


Reply via email to