mirror of
https://github.com/isc-projects/bind9.git
synced 2026-04-22 23:01:43 -04:00
4218. [bug] Potential null pointer dereference on out of memory if mmap is not supported. [RT #40777]
This commit is contained in:
parent
cc52a16096
commit
4dd41c7d59
3 changed files with 8 additions and 0 deletions
2
CHANGES
2
CHANGES
|
|
@ -1,3 +1,5 @@
|
|||
4218. [bug] Potential null pointer dereference on out of memory if mmap is not supported. [RT #40777]
|
||||
|
||||
4217. [protocol] Add support for CSYNC. [RT #40532]
|
||||
|
||||
4216. [cleanup] Silence static analysis warnings. [RT #40649]
|
||||
|
|
|
|||
|
|
@ -678,6 +678,9 @@ isc_file_mmap(void *addr, size_t len, int prot,
|
|||
len = end - offset;
|
||||
|
||||
buf = malloc(len);
|
||||
if (buf == NULL)
|
||||
return (NULL);
|
||||
|
||||
ret = read(fd, buf, len);
|
||||
if (ret != (ssize_t) len) {
|
||||
free(buf);
|
||||
|
|
|
|||
|
|
@ -757,6 +757,9 @@ isc_file_mmap(void *addr, size_t len, int prot,
|
|||
len = end - offset;
|
||||
|
||||
buf = malloc(len);
|
||||
if (buf == NULL)
|
||||
return (NULL);
|
||||
|
||||
ret = read(fd, buf, (unsigned int) len);
|
||||
if (ret != (ssize_t) len) {
|
||||
free(buf);
|
||||
|
|
|
|||
Loading…
Reference in a new issue