]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Check each member of the ifconf structure passed to SIOCGIFCONF
authorTom Hughes <tom@compton.nu>
Mon, 18 Jul 2005 22:45:55 +0000 (22:45 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 18 Jul 2005 22:45:55 +0000 (22:45 +0000)
individually to avoid problems with padding bytes on 64 bit platforms.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4167

coregrind/m_syswrap/syswrap-generic.c

index 6163552c6809c2e8d7e01a1a208e01c1abc84c19..d3b02d4b18b477ddda385acc5d0e40aa68be0ddb 100644 (file)
@@ -3257,7 +3257,12 @@ PRE(sys_ioctl)
         if (!VG_(is_kerror)(RES) && RES == 0)
         POST_MEM_WRITE(ARG3, sizeof(struct ifconf));
       */
-      PRE_MEM_READ( "ioctl(SIOCGIFCONF)", ARG3, sizeof(struct vki_ifconf));
+      PRE_MEM_READ( "ioctl(SIOCGIFCONF)",
+                    (Addr)&((struct vki_ifconf *)ARG3)->ifc_len,
+                    sizeof(((struct vki_ifconf *)ARG3)->ifc_len));
+      PRE_MEM_READ( "ioctl(SIOCGIFCONF)",
+                    (Addr)&((struct vki_ifconf *)ARG3)->vki_ifc_buf,
+                    sizeof(((struct vki_ifconf *)ARG3)->vki_ifc_buf));
       if ( ARG3 ) {
         // TODO len must be readable and writable
         // buf pointer only needs to be readable