Skip to content

Commit 67bef16

Browse files
committed
Cygwin: mmap_list::try_map: fix a condition in a test of an mmap request
In testing whether the requested area is contained in an existing mapped region, an incorrect condition was used due to a misinterpretation of the u_addr and u_len variables. Addresses: https://cygwin.com/pipermail/cygwin/2024-December/256913.html Fixes: c68de3a ("* mmap.cc (class mmap_record): Declare new map_pages method with address parameter.") Signed-off-by: Ken Brown <[email protected]>
1 parent 677e315 commit 67bef16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

winsup/cygwin/mm/mmap.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ mmap_list::try_map (void *addr, size_t len, int new_prot, int flags, off_t off)
651651
break;
652652
if (rec)
653653
{
654-
if (u_addr > (caddr_t) addr || u_addr + len < (caddr_t) addr + len
654+
if (u_addr > (caddr_t) addr || u_addr + u_len < (caddr_t) addr + len
655655
|| !rec->compatible_flags (flags))
656656
{
657657
/* Partial match only, or access mode doesn't match. */

0 commit comments

Comments
 (0)