Attachments (1)
Change History (4)
by , 12 years ago
Attachment: | ms542-4074.patch added |
---|
comment:1 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 12 years ago
I'm very far from being a huge advocate of C++ and tend to make very limited use of its capability in other projects (GDAL...), but such a bug would strongly militate to use std::string facility concerning automatic memory allocation... Counting the number of bytes is just not maintenable.
Is there a policy in mapserver to only use C ?
comment:3 by , 12 years ago
Even,
There is no policy strictly against using c++, but historically we will stick to C when possible. I don't see that changing in the short term although I personally have nothing against switching.
I agree that the current issue is a problem that can bite elsewhere in the code. Rather than using std::string which would be too disruptive, I would advocate using #defines and strlen in these cases, as unless I am mistaken in that case the strlen call is optimized out by the compiler.
#define my_sql_string "select from \"%s\" where \"%s\"='%s';" char *final_sql = malloc(strlen(my_sql_string)+ ... ); }
changing malloc to respect quotes from #2006