mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-08-20 23:20:51 +08:00
posix/mmap: validate addr non-null before alignment check
This commit is contained in:
@@ -141,11 +141,11 @@ void *mmap(
|
||||
|
||||
/* Check for illegal addresses. Watch out for address wrap. */
|
||||
if ( map_fixed ) {
|
||||
if ((uintptr_t)addr & PAGE_MASK) {
|
||||
if ( addr == NULL ) {
|
||||
errno = EINVAL;
|
||||
return MAP_FAILED;
|
||||
}
|
||||
if ( addr == NULL ) {
|
||||
if ((uintptr_t)addr & PAGE_MASK) {
|
||||
errno = EINVAL;
|
||||
return MAP_FAILED;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user