[cvsnt-dev] Re: Crasch in cvsapi/CCodepage::TranscodeBuffer()

Tony Hoyle tmh at nodomain.org
Mon Jan 17 14:56:43 GMT 2005


Community technical support mailing list was retired 2010 and replaced with a professional technical support team. For assistance please contact: Pre-sales Technical support via email to sales@march-hare.com.


Richard Wirth wrote:
> Hello Tony,
> 
>   there is a potential crash in cvsapi/Codepage.cpp lin 418
> 
>   "if((ic = iconv_open(to,from))<0)" ic is declared as iconv_t which
>   in turn is a pointer. And pointers can not get less than zero...
>   so the if-condition will never get true, and subsequent calls to
>   iconv() with invalid ic will crash...
>   
It's correct according to the man page, plus it does in fact work as 
I've had quite a few failures during testing.  It's possible that 
certain compilers may not handle this but I'm not really sure how to 
work around it - iconv_open returns a negative value on error.

Tony


More information about the cvsnt-dev mailing list