bug-cgicc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-cgicc] 64bit bug in multipart/formdata uploads


From: Jim Hull
Subject: [bug-cgicc] 64bit bug in multipart/formdata uploads
Date: Wed, 02 May 2007 00:18:00 -0000
User-agent: Thunderbird 2.0.0.0 (X11/20070326)

This is a simple string::size_type vs u_int bug I found today while testing our tools on a 64bit platform.

inside extractBetween(), 'start' is declared as 'unsigned int' and then tested against std::string::npos, which on a 64bit system will always be false.

Iv'e attached a patch with the fix.

Thanks!

        Jim
diff -ruwN cgicc-3.2.3/cgicc/CgiUtils.cpp cgicc-3.2.3-jim/cgicc/CgiUtils.cpp
--- cgicc-3.2.3/cgicc/CgiUtils.cpp      2004-06-12 08:24:31.000000000 -0700
+++ cgicc-3.2.3-jim/cgicc/CgiUtils.cpp  2007-05-01 16:56:30.000000000 -0700
@@ -211,7 +211,7 @@
                      const std::string& separator2)
 {
   std::string result;
-  unsigned int start, limit;
+  std::string::size_type start, limit;
   
   start = data.find(separator1, 0);
   if(start != std::string::npos) {

reply via email to

[Prev in Thread] Current Thread [Next in Thread]