[Libevent-users] [patch]1.3 revision 454 bug in strsep()

claris_chen-news at yahoo.com.cn claris_chen-news at yahoo.com.cn
Sat Sep 29 22:38:10 EDT 2007


1.3 revision 454  strsep() function has a bug which
  will cause valid parse with evhttp_parse_request_line while do strcmp to method version and uri.
   
   
  --- http.c (revision 454)
+++ http.c (working copy)
  @@ -147,9 +158,14 @@
  tok = *s;
  d = strstr(tok, del);
  if (d)
+ {
+  *s = '\0';//terminate the string whith NULL.
   *s = d + strlen(del);
+ }
  else
+ {
   *s = NULL;
+ }
  return tok;
 }
 #endif
   
  Chen shaowei
   

       
---------------------------------
ÑÅ»¢ÓÊÏ䣬ÖÕÉú»ï°é£¡ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://monkeymail.org/archives/libevent-users/attachments/20070930/761052cd/attachment.htm


More information about the Libevent-users mailing list