mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
fix handling of ssid "-" etc; we're writing 1 byte past the
end of the result buffer Noticed by: Sepherosa Zieha Reviewed by: cperciva MFC after: 2 weeks
This commit is contained in:
parent
3e6f3ff080
commit
0972edc076
1 changed files with 3 additions and 2 deletions
|
|
@ -1913,9 +1913,10 @@ get_string(const char *val, const char *sep, u_int8_t *buf, int *lenp)
|
|||
}
|
||||
len = p - buf;
|
||||
/* The string "-" is treated as the empty string. */
|
||||
if (!hexstr && len == 1 && buf[0] == '-')
|
||||
if (!hexstr && len == 1 && buf[0] == '-') {
|
||||
len = 0;
|
||||
if (len < *lenp)
|
||||
memset(buf, 0, *lenp);
|
||||
} else if (len < *lenp)
|
||||
memset(p, 0, *lenp - len);
|
||||
*lenp = len;
|
||||
return val;
|
||||
|
|
|
|||
Loading…
Reference in a new issue