bug-cgicc
[Top][All Lists]
Advanced

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

[bug-cgicc] cgicc and 64bit OS


From: Vyacheslav Ignatyuk
Subject: [bug-cgicc] cgicc and 64bit OS
Date: Wed, 27 Oct 2004 17:49:57 +0300
User-agent: KMail/1.6.2

cgicc improperly handles multipart/form-data on 64bit OS.

address@hidden pgml2]$ cat /etc/issue
Fedora Core release 2 (Tettnang)
Kernel \r on an \m

address@hidden pgml2]$ uname -a
Linux mars 2.6.5-1.358 #1 Sat May 8 09:01:26 EDT 2004 x86_64 x86_64 x86_64 
GNU/Linux


Warnings are issued during compilation:

CgiUtils.cpp: In function `std::string cgicc::extractBetween(const
   std::string&, const std::string&, const std::string&)':
CgiUtils.cpp:217: warning: comparison is always true due to limited range of
   data type
CgiUtils.cpp:220: warning: comparison is always true due to limited range of
   data type


Trouble caused by 
std::string cgicc::extractBetween(const std::string&,                     
const std::string&, const std::string&) function.

local variables "start" and "limit" originally have type unsigned int and 
should be changed to the same size type is used by std::string.

So line 
  unsigned int start, limit;
should be replaced with this one
  std::string::size_type start, limit;

This is the simplest way to get gid of this problem.
I didn't check full source tree but IMHO all local counters should not be 
declared  as unsigned int or unsigned long. Better to use size_t or 
std::STL_CONTAINER::sitze_type typedef.

Thanks
Vyacheslav Ignatyuk

PS: Is this good idea to fetch file is being uploaded into memory 
(std::string)? We usually upload huge files so there is a problem. I know 
otherwise we'll got a problem with temporary files but cgicc::Cgicc class 
might provide garbage collection in destructor.
Thanks again






reply via email to

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