You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by st...@apache.org on 2003/03/06 13:21:18 UTC

cvs commit: apr/mmap/win32 mmap.c

striker     2003/03/06 04:21:17

  Modified:    mmap/unix mmap.c
               mmap/win32 mmap.c
  Log:
  Consistently fail on all platforms.
  
  * mmap/unix/mmap.c
  
    (apr_mmap_create): return APR_EINVAL when size == 0.
  
  * mmap/win32/mmap.c
  
    (apr_mmap_create): return APR_EINVAL when size == 0.
  
  Revision  Changes    Path
  1.48      +3 -0      apr/mmap/unix/mmap.c
  
  Index: mmap.c
  ===================================================================
  RCS file: /home/cvs/apr/mmap/unix/mmap.c,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- mmap.c	7 Jan 2003 00:52:55 -0000	1.47
  +++ mmap.c	6 Mar 2003 12:21:16 -0000	1.48
  @@ -122,6 +122,9 @@
       apr_int32_t native_flags = 0;
   #endif
   
  +    if (size == 0)
  +        return APR_EINVAL;
  +    
       if (file == NULL || file->filedes == -1 || file->buffered)
           return APR_EBADF;
       (*new) = (apr_mmap_t *)apr_pcalloc(cont, sizeof(apr_mmap_t));
  
  
  
  1.19      +3 -0      apr/mmap/win32/mmap.c
  
  Index: mmap.c
  ===================================================================
  RCS file: /home/cvs/apr/mmap/win32/mmap.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- mmap.c	7 Jan 2003 00:52:55 -0000	1.18
  +++ mmap.c	6 Mar 2003 12:21:17 -0000	1.19
  @@ -114,6 +114,9 @@
       DWORD offlo;
       DWORD offhi;
   
  +    if (size == 0)
  +        return APR_EINVAL;
  +    
       if (flag & APR_MMAP_WRITE)
           fmaccess |= PAGE_READWRITE;
       else if (flag & APR_MMAP_READ)