Skip to content
Snippets Groups Projects
Commit acb2ecdc authored by Gary E. Miller's avatar Gary E. Miller :speech_balloon:
Browse files

ntp_control: Stop potentially dereferencing a NULL pointer.

parent ed899129
No related branches found
No related tags found
No related merge requests found
Pipeline #33919706 passed
......@@ -2892,6 +2892,7 @@ write_variables(
const struct ctl_var *v;
int ext_var;
char *valuep;
char nulltxt[1] = { '\0' };
long val;
size_t octets;
char *vareqv;
......@@ -2936,6 +2937,9 @@ write_variables(
ctl_error(CERR_PERMISSION);
return;
}
if (NULL == valuep)
valuep = nulltxt;
errno = 0;
if (!ext_var &&
(*valuep == '\0' ||
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment