Nmap Development mailing list archives

Re: [nmap-svn] r29152 - nmap-exp/sean/nmap-protov6


From: Henri Doreau <henri.doreau () gmail com>
Date: Mon, 9 Jul 2012 00:02:12 +0200

2012/7/8  <commit-mailer () insecure org>:
Author: sean
Date: Sun Jul  8 12:55:49 2012
New Revision: 29152

Log:
Added type cast to char*, also decremented payload's size by one to correct for the additional null byte at the end.


Modified:
   nmap-exp/sean/nmap-protov6/scan_engine.cc

Modified: nmap-exp/sean/nmap-protov6/scan_engine.cc
==============================================================================
--- nmap-exp/sean/nmap-protov6/scan_engine.cc   (original)
+++ nmap-exp/sean/nmap-protov6/scan_engine.cc   Sun Jul  8 12:55:49 2012
@@ -3309,13 +3309,13 @@
     }
     break;
     case IPPROTO_HOPOPTS:{
-        char* payload="\x3b\x01\x00\x01\x04\x00\x00\x00\x00\x01\x04\x00\x00\x00\x00\x00";
-        int payload_length=sizeof(payload);
+        char* payload=(char*)"\x3b\x01\x00\x01\x04\x00\x00\x00\x00\x01\x04\x00\x00\x00\x00\x00";
+        int payload_length=sizeof(payload)-1;
         packet = build_ipv6_raw(&src_in6->sin6_addr, &dst_in6->sin6_addr,
                                  0, ipid, proto, o.ttl,
                                 payload, payload_length, packetlen);
     }
-    break;
+
     default:
       packet = build_ipv6_raw(&src_in6->sin6_addr, &dst_in6->sin6_addr,
                               0, ipid, proto, o.ttl,

Hi,

I think that in this case sizeof(payload) equals sizeof(char *)
instead of the actual buffer length... I haven't checked the context
but it might be that this is not what you want. See the code attached.

Regards.

-- 
Henri

Attachment: size.c
Description:

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/

Current thread: