Skip to content

Commit

Permalink
Fix load of null pointer
Browse files Browse the repository at this point in the history
Found by: 0_o I am EMPTY, mister EMPTY, ZarTek-Creole
Patch by: michaelortmann
Fixes: #1389
  • Loading branch information
michaelortmann authored Feb 13, 2023
1 parent a602590 commit 23386ce
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1700,6 +1700,12 @@ char *traced_natip(ClientData cd, Tcl_Interp *irp, EGG_CONST char *name1,
int r;
struct in_addr ia;

/* Recover trace in case of unset. */
if (flags & TCL_TRACE_DESTROYED) {
Tcl_TraceVar2(irp, name1, name2, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, traced_natip, cd);
return NULL;
}

value = Tcl_GetVar2(irp, name1, name2, TCL_GLOBAL_ONLY);
if (*value) {
r = inet_pton(AF_INET, value, &ia);
Expand Down

0 comments on commit 23386ce

Please sign in to comment.