mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 16:57:00 +08:00
check for errors in sscanf
This commit is contained in:
@@ -88,7 +88,10 @@ char *unescape_url(const char *url, unsigned len, unsigned *out_len)
|
||||
b[1] = url[pos + 2];
|
||||
b[2] = 0;
|
||||
|
||||
sscanf(b, "%02x", &u);
|
||||
if (sscanf(b, "%02x", &u) <= 0) {
|
||||
free(msg);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
msg[pos++] = u;
|
||||
i += 3;
|
||||
|
||||
Reference in New Issue
Block a user