Skip to content

Commit a060d02

Browse files
committed
Fix potential crash when no target name is present
Signed-off-by: Simo Sorce <[email protected]>
1 parent 646c7fc commit a060d02

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ntlm.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,9 @@ static int ntlm_decode_u16l_str_hdr(struct ntlm_ctx *ctx,
325325
safefree(out);
326326
} else {
327327
/* make sure to terminate output string */
328-
out[outlen] = '\0';
328+
if (out) {
329+
out[outlen] = '\0';
330+
}
329331
}
330332

331333
*str = out;

0 commit comments

Comments
 (0)