commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r504988 - /jakarta/commons/proper/daemon/trunk/src/native/nt/procrun/src/utils.c
Date Thu, 08 Feb 2007 18:17:33 GMT
Author: mturk
Date: Thu Feb  8 10:17:32 2007
New Revision: 504988

URL: http://svn.apache.org/viewvc?view=rev&rev=504988
Log:
Fix overrun bug. Thanks to Rohit S. Singh for spotting the bug, although I made a fix different
from his patch.

Modified:
    jakarta/commons/proper/daemon/trunk/src/native/nt/procrun/src/utils.c

Modified: jakarta/commons/proper/daemon/trunk/src/native/nt/procrun/src/utils.c
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/daemon/trunk/src/native/nt/procrun/src/utils.c?view=diff&rev=504988&r1=504987&r2=504988
==============================================================================
--- jakarta/commons/proper/daemon/trunk/src/native/nt/procrun/src/utils.c (original)
+++ jakarta/commons/proper/daemon/trunk/src/native/nt/procrun/src/utils.c Thu Feb  8 10:17:32
2007
@@ -850,16 +850,17 @@
 
     l = __apxGetMultiSzLengthW(szStr, &c);    
     b = rv = apxPoolCalloc(hPool, (l + c + 2) * sizeof(WCHAR));
-    do {
+
+    while (c > 0) {
         if (*p)
             *b++ = *p;
         else {
             *b++ = L'\r';
             *b++ = L'\n';
+            c--;
         }
         p++;
-    } while( *p || *(p + 1));
- 
+    }
     return rv;
 }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message