Re: itoa() unresolved

From: Date: Thu, 04 Feb 1999 17:22:50 +0000
Subject: Re: itoa() unresolved
References: 1 2 3 4  Groups: php.dev 
Request: Send a blank email to php-dev+get-3888@lists.php.net to get a copy of this message
Sascha Schumann wrote: > > On Tue, Feb 02, 1999 at 05:21:51PM -0500, Shane Caraveo wrote: > > > > Something does need to be there, as that itoa (adding bytes to the > > malloc call) fixed a mega crash in odbc on windows at least, and I would > > assume on unix as well. > > > > Shane > > > > If the platform does not have a native itoa, compilation of unified_odbc.c > will fail. Beside that, the odbc file uses it this way: > > char tmp[5]; > int cur_opt; > > strlen(itoa(cur_opt, tmp, 10)) > > What will happen, if cur_opt > 9999? The missing null byte will lead to > trouble, I suppose (if itoa does not try to access the 6th byte and generates > a SIGSEGV before). This is probably not a very good example for safe > programming ;) > No, and I knew it wasn't when I put it there. As I understand the code, curopt is the number of connections to made to the odbc manager. If someone can make 10000 connections to an odbc manager, they're god (at least on nt). Anyway, yes it needs to be fixed, but I needed an immediate fix before going out the door to the airport. Shane -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#3888) next »