[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Neon and non-ascii error messages

From: Alexander Klenin <klenin_at_gmail.com>
Date: Wed, 23 Jan 2008 04:26:55 +1000

I have encountered a problem on a non-US Windows XP (Russian in my case).
It can be reproduced with both TortoiseSVN and command-line client
built from TSVN distribution.
If error happens during network operation, Neon library tries to do
some processing
of error message. Alas, it uses plain char* datatype, which results in ASSERT
in debug mode or mangled message in release mode.

A part of typical stacktrace below:

         msvcr90d.dll!_chvalidator_l(localeinfo_struct * plocinfo=0x024af46c,
int c=-57, int mask=32) Line 68 + 0x2b bytes C++
         msvcr90d.dll!_iscntrl_l(int c=-57, localeinfo_struct *
plocinfo=0x00000000) Line 300 + 0x4f bytes C++
         msvcr90d.dll!iscntrl(int c=-57) Line 313 + 0xb bytes C++
> TortoiseProc.exe!ne_strclean(char * str=0x020128a4) Line 354 + 0xd bytes C
         TortoiseProc.exe!ne_get_error(ne_session_s * sess=0x020127e0) Line
280 + 0xe bytes C
         TortoiseProc.exe!generate_error(svn_ra_neon__request_t *
req=0x022c1538, apr_pool_t * pool=0x022b6400) Line 582 + 0x10 bytes C
         TortoiseProc.exe!svn_ra_neon__request_dispatch(int *
code_p=0x024af530, svn_ra_neon__request_t * req=0x022c1538, apr_hash_t
* extra_headers=0x00000000, const char * body=0x00000000, int
okay_1=200, int okay_2=0, apr_pool_t * pool=0x022b6400) Line 1448 +
0xd bytes C

The offending function in ne_strings.c look like this:

char *ne_strclean(char *str)
{
    char *pnt;
    for (pnt = str; *pnt; pnt++)
        if (iscntrl(*pnt) || !isprint(*pnt)) *pnt = ' ';
    return str;
}

And iscntrl() call fails trying to validate argument range.
I am not sure how to fix this correctly and who to approach with the fix.

Perhaps there is some compile-time configuration option for Neon to use
wide chars or at least unsigned chars?

-- 
Alexander S. Klenin
Insight Experts Ltd.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_tortoisesvn.tigris.org
For additional commands, e-mail: dev-help_at_tortoisesvn.tigris.org
Received on 2008-01-22 19:27:06 CET

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.