Skip to content

Commit

Permalink
Check for NULL before doing anything else
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Apr 19, 2014
1 parent 38e654d commit ff97131
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/print.c
Expand Up @@ -318,14 +318,14 @@ size_t vp_prints_value(char *out, size_t outlen, VALUE_PAIR const *vp, int8_t qu

size_t len = 0, freespace = outlen;

if (!vp) return 0;

VERIFY_VP(vp);

if (outlen == 0) return vp->length;

*out = '\0';

if (!vp) return 0;

switch (vp->da->type) {
case PW_TYPE_STRING:
/* need to copy the escaped value, but quoted */
Expand Down

0 comments on commit ff97131

Please sign in to comment.