[Libevent-users] [patch] 1.3 revision strsep last i post have a mistake

claris_chen-news at yahoo.com.cn claris_chen-news at yahoo.com.cn
Sat Sep 29 22:52:50 EDT 2007


I am pretty sorry that the last patch I posted is not correct.

this one will sovlve it.

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)
+ {
+  *d = '\0';//terminate the string whith NULL.
   *s = d + strlen( del );
+ }
  else
+ {
   *s = NULL;
+ }
  return tok;
 }
 #endif
   
  Chen shaowei

       
---------------------------------
 @yahoo.cn ÐÂÓòÃû¡¢ÎÞÏÞÁ¿£¬¿ìÀ´ÇÀ×¢£¡
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://monkeymail.org/archives/libevent-users/attachments/20070930/619b74c1/attachment.htm


More information about the Libevent-users mailing list