[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r8849: backport 8844: avoid infinite loop on unexpected controller (in tor/branches/tor-0_1_1-patches: . src/or)



Author: arma
Date: 2006-10-28 23:36:53 -0400 (Sat, 28 Oct 2006)
New Revision: 8849

Modified:
   tor/branches/tor-0_1_1-patches/ChangeLog
   tor/branches/tor-0_1_1-patches/src/or/buffers.c
Log:
backport 8844: avoid infinite loop on unexpected controller input.


Modified: tor/branches/tor-0_1_1-patches/ChangeLog
===================================================================
--- tor/branches/tor-0_1_1-patches/ChangeLog	2006-10-28 16:13:15 UTC (rev 8848)
+++ tor/branches/tor-0_1_1-patches/ChangeLog	2006-10-29 03:36:53 UTC (rev 8849)
@@ -1,4 +1,4 @@
-Changes in version 0.1.1.25 - 2006-10-?? [ongoing]
+Changes in version 0.1.1.25 - 2006-11-?? [ongoing]
   o Major bugfixes:
     - When a client asks us to resolve (not connect to) an address,
       and we have a cached answer, give them the cached answer.
@@ -24,6 +24,7 @@
     - Avoid possibility of controller-triggered crash when misusing
       certain commands from a v0 controller on platforms that do not
       handle printf("%s",NULL) gracefully.
+    - Avoid infinite loop on unexpected controller input.
 
 
 Changes in version 0.1.1.24 - 2006-09-29

Modified: tor/branches/tor-0_1_1-patches/src/or/buffers.c
===================================================================
--- tor/branches/tor-0_1_1-patches/src/or/buffers.c	2006-10-28 16:13:15 UTC (rev 8848)
+++ tor/branches/tor-0_1_1-patches/src/or/buffers.c	2006-10-29 03:36:53 UTC (rev 8849)
@@ -1232,7 +1232,7 @@
   size_t len_rest;
   char *cp;
   _split_range(buf, start, &len, &len_rest);
-  cp = memchr(buf->cur, c, len);
+  cp = memchr(start, c, len);
   if (cp || !len_rest)
     return cp;
   return memchr(buf->mem, c, len_rest);