Instead of crashing, print "NULL" when printfrr callback for
nexthops is called for a NULL nexthop argument.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
const char *s, *v_is = "", *v_via = "", *v_viaif = "via ";
ssize_t ret = 3;
+ /* NULL-check */
+ if (nexthop == NULL) {
+ if (fmt[2] == 'v' && fmt[3] == 'v')
+ ret++;
+
+ strlcpy(buf, "NULL", bsz);
+
+ return ret;
+ }
+
switch (fmt[2]) {
case 'v':
if (fmt[3] == 'v') {