← Commit list

acb4fcb2ef

Daniel Stenberg
Daniel Stenberg
2026-03-18
SUCCESS Duration: 273s

Subject

tool_msgs: avoid null pointer deref for early errors

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

src/tool_msgs.c+3 -3
@@ -78,7 +78,7 @@ static void voutf(const char *prefix, const char *fmt, va_list ap)
*/
void notef(const char *fmt, ...)
{
- if(global->tracetype) {
+ if(global && global->tracetype) {
va_list ap;
va_start(ap, fmt);
voutf(NOTE_PREFIX, fmt, ap);
@@ -92,7 +92,7 @@ void notef(const char *fmt, ...)
*/
void warnf(const char *fmt, ...)
{
- if(!global->silent) {
+ if(!global || !global->silent) {
va_list ap;
va_start(ap, fmt);
voutf(WARN_PREFIX, fmt, ap);
@@ -128,7 +128,7 @@ void helpf(const char *fmt, ...)
*/
void errorf(const char *fmt, ...)
{
- if(!global->silent || global->showerror) {
+ if(!global || !global->silent || global->showerror) {
va_list ap;
va_start(ap, fmt);
voutf(ERROR_PREFIX, fmt, ap);