From: Jorge Pereira Date: Fri, 29 May 2015 18:54:51 +0000 (-0300) Subject: bugfix a SIGSEGV during 'show debug condition' in radmin X-Git-Tag: release_3_0_9~308 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb25ebd6e5f17b681db9fab9433f770673a2a994;p=thirdparty%2Ffreeradius-server.git bugfix a SIGSEGV during 'show debug condition' in radmin --- diff --git a/src/main/parser.c b/src/main/parser.c index 009989e0681..b41c8944533 100644 --- a/src/main/parser.c +++ b/src/main/parser.c @@ -54,7 +54,14 @@ size_t fr_cond_sprint(char *buffer, size_t bufsize, fr_cond_t const *in) char *end = buffer + bufsize - 1; fr_cond_t const *c = in; + rad_assert(buffsize > 0); + next: + if (!c) { + buffer[0] = '\0'; + return 0; + } + if (c->negate) { *(p++) = '!'; /* FIXME: only allow for child? */ }