]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Don't use fr_sbuff_in_bstrcpy_buffer log messages may not be talloced
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 24 Dec 2020 02:27:14 +0000 (18:27 -0800)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 24 Dec 2020 02:27:36 +0000 (18:27 -0800)
src/lib/util/log.c

index 569bd9c64c6010624d2798cda87f940df1dde7c2..042751e2e9170ed5a08199f17971a8179d89a1ee 100644 (file)
@@ -586,7 +586,7 @@ int fr_vlog_perror(fr_log_t const *log, fr_log_type_t type, char const *file, in
                        va_end(aq);
 
                        fr_sbuff_in_strcpy(&sbuff, ": ");
-                       fr_sbuff_in_bstrcpy_buffer(&sbuff, error);
+                       fr_sbuff_in_strcpy(&sbuff, error);      /* may not be talloced with const */
                        error = fr_sbuff_start(&sbuff);
                }
        /*
@@ -626,7 +626,7 @@ int fr_vlog_perror(fr_log_t const *log, fr_log_type_t type, char const *file, in
        while ((error = fr_strerror_pop())) {
                if (f_rules->subsq_prefix) {
                        fr_sbuff_set(&sbuff, &prefix_m);
-                       fr_sbuff_in_bstrcpy_buffer(&sbuff, error);
+                       fr_sbuff_in_strcpy(&sbuff, error);      /* may not be talloced with const */
                        error = fr_sbuff_start(&sbuff);
                }