about summary refs log tree commit diff stats
path: root/src/wrapped32/wrappedlibc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wrapped32/wrappedlibc.c')
-rwxr-xr-xsrc/wrapped32/wrappedlibc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wrapped32/wrappedlibc.c b/src/wrapped32/wrappedlibc.c
index e1fedcf8..a18f8780 100755
--- a/src/wrapped32/wrappedlibc.c
+++ b/src/wrapped32/wrappedlibc.c
@@ -3212,7 +3212,7 @@ EXPORT void* my32_shmat(x64emu_t*emu, int shmid, void* shmaddr, int flags)
         if(shmctl(shmid, IPC_STAT, &ds)>=0)
             sz = ds.shm_segsz;
     }
-    if(!shmaddr) {
+    if(!shmaddr && sz) {
         shmaddr = find31bitBlockNearHint(shmaddr, sz, 0);
     }
     void* ret = shmat(shmid, shmaddr, flags);