64bit bug in multipart/formdata uploads

View: New views
1 Messages — Rating Filter:   Alert me  

64bit bug in multipart/formdata uploads

by Jim Hull-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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) {

_______________________________________________
bug-cgicc mailing list
bug-cgicc@...
http://lists.gnu.org/mailman/listinfo/bug-cgicc