Browse Source

r11852@catbus: nickm | 2007-02-20 17:25:17 -0500
Reverse arguments in memset() call in no-mmap version of tor_munmap_file(). Resolves bug 392. Spotted by "fookoowa"--thanks!


svn:r9604

Nick Mathewson 18 years ago
parent
commit
275ce1d2a4
2 changed files with 3 additions and 1 deletions
  1. 2 0
      ChangeLog
  2. 1 1
      src/common/compat.c

+ 2 - 0
ChangeLog

@@ -42,6 +42,8 @@ Changes in version 0.1.2.8-alpha - 2007-??-??
     - Mask out all signals in sub-threads; only the libevent signal handler
     - Mask out all signals in sub-threads; only the libevent signal handler
       should be processing them. This should prevent some crashes on some
       should be processing them. This should prevent some crashes on some
       machines using pthreads. (Patch from coderman.)
       machines using pthreads. (Patch from coderman.)
+    - Fix switched arguments on memset in the implementation of tor_munmap()
+      for systems with no mmap() call.
 
 
   o Minor features (controller):
   o Minor features (controller):
     - Warn the user when an application uses the obsolete binary v0
     - Warn the user when an application uses the obsolete binary v0

+ 1 - 1
src/common/compat.c

@@ -280,7 +280,7 @@ tor_munmap_file(tor_mmap_t *handle)
 {
 {
   char *d = (char*)handle->data;
   char *d = (char*)handle->data;
   tor_free(d);
   tor_free(d);
-  memset(handle, sizeof(tor_mmap_t), 0);
+  memset(handle, 0, sizeof(tor_mmap_t));
   tor_free(handle);
   tor_free(handle);
 }
 }
 #endif
 #endif