]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
If input to %pV was null substitute for (null) as with strings
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 25 Jan 2018 03:15:56 +0000 (20:15 -0700)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 25 Jan 2018 19:12:24 +0000 (12:12 -0700)
src/lib/util/print.c

index 672ba263ed1ca786f576d58b5673e755e894ed2c..399e305858547769331118aeb0ecd1c56f3e1d07 100644 (file)
@@ -649,12 +649,16 @@ char *fr_vasprintf(TALLOC_CTX *ctx, char const *fmt, va_list ap)
                                 *      string need to occur in the NULL ctx so we don't fragment
                                 *      any pool associated with it.
                                 */
-                               subst = fr_value_box_asprint(NULL, in, '"');
-                               if (!subst) {
-                                       talloc_free(out);
-                                       va_end(ap_p);
-                                       va_end(ap_q);
-                                       return NULL;
+                               if (in) {
+                                       subst = fr_value_box_asprint(NULL, in, '"');
+                                       if (!subst) {
+                                               talloc_free(out);
+                                               va_end(ap_p);
+                                               va_end(ap_q);
+                                               return NULL;
+                                       }
+                               } else {
+                                       subst = talloc_strdup(NULL, "(null)");
                                }
 
                        do_splice: