← Commit list

1afc4bb768

Daniel Stenberg
Daniel Stenberg
2025-10-30
SUCCESS Duration: 149s

Subject

tool/var: explain how the null termination byte is there

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/var.c+1 -0
@@ -362,6 +362,7 @@ static ParameterError addvariable(const char *name,
p = calloc(1, sizeof(struct tool_var) + nlen);
if(p) {
memcpy(p->name, name, nlen);
+ /* the null termination byte is already present from above */
p->content = contalloc ? content : memdup0(content, clen);
if(p->content) {