Browse Source

Check for NULL in tor_assertf_nonfatal()

rl1987 6 years ago
parent
commit
537ad0bca3
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/lib/log/util_bug.c

+ 2 - 1
src/lib/log/util_bug.c

@@ -145,7 +145,8 @@ tor_bug_occurred_(const char *fname, unsigned int line,
     log_warn(LD_BUG, "%s:%u: %s: Non-fatal assertion %s failed.%s",
     log_warn(LD_BUG, "%s:%u: %s: Non-fatal assertion %s failed.%s",
              fname, line, func, expr, once_str);
              fname, line, func, expr, once_str);
     tor_asprintf(&buf, "Non-fatal assertion %s failed in %s at %s:%u%s%s",
     tor_asprintf(&buf, "Non-fatal assertion %s failed in %s at %s:%u%s%s",
-                 expr, func, fname, line, fmt ? " : " : "", extra);
+                 expr, func, fname, line, fmt ? " : " : "",
+                 extra ? extra : "");
     tor_free(extra);
     tor_free(extra);
   }
   }
   log_backtrace(LOG_WARN, LD_BUG, buf);
   log_backtrace(LOG_WARN, LD_BUG, buf);