mirror of
https://github.com/NLnetLabs/unbound.git
synced 2024-09-21 06:37:08 +00:00
fix heap-buffer-overflow issue in function cfg_mark_ports of file util/config_file.c
This commit is contained in:
parent
e1aeabde44
commit
193401e754
@ -1761,6 +1761,10 @@ cfg_mark_ports(const char* str, int allow, int* avail, int num)
|
||||
#endif
|
||||
if(!mid) {
|
||||
int port = atoi(str);
|
||||
if(port < 0) {
|
||||
log_err("Prevent out-of-bounds access to array avail");
|
||||
return 0;
|
||||
}
|
||||
if(port == 0 && strcmp(str, "0") != 0) {
|
||||
log_err("cannot parse port number '%s'", str);
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user