[Snort-devel] fix for ip/tcp options crash

Andrew Griffiths nullptr at ...316...
Mon Apr 30 19:01:10 EDT 2001


Heres a fix to the ip/tcp options crash. You can observe the crash by using the isic packages with the tcp,ip options on 100% and a couple of seconds. Enjoy! 

(well, it works for me!)

--- log_old.c	Tue Apr 17 15:31:29 2001
+++ log.c	Mon Apr 30 01:12:02 2001
@@ -1946,7 +1946,7 @@
 
                 if(p->ip_options[i].len)
                 {
-                    for(j = 0; j < p->ip_options[i].len - 2; j += 2)
+                    for(j = 0; j < p->ip_options[i].len - 1; j += 2)
                     {
                         fprintf(fp, "%02X%02X ", p->ip_options[i].data[j], p->ip_options[i].data[j + 1]);
                     }
@@ -2060,7 +2060,7 @@
                     fprintf(fp, "Opt %d (%d): ", p->tcp_options[i].code,
                             (int) p->tcp_options[i].len);
 
-                    for(j = 0; j < p->tcp_options[i].len - 2; j += 2)
+                    for(j = 0; j < p->tcp_options[i].len - 1; j += 2)
                     {
                         fprintf(fp, "%02X%02X ", p->tcp_options[i].data[j], 
                                 p->tcp_options[i].data[j + 1]);


--
www.tasmail.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix.patch
Type: application/octet-stream
Size: 917 bytes
Desc: not available
URL: <https://lists.snort.org/pipermail/snort-devel/attachments/20010501/b088b43f/attachment.obj>


More information about the Snort-devel mailing list