Changeset 9032


Ignore:
Timestamp:
Sep 2, 2009, 3:26:34 PM (13 years ago)
Author:
charles
Message:

(trunk, libT) fix code in the UTF8-to-JSON serializer that could fall into an infinite loop when fed some inputs. This may be ticket #2326 or may get its own retroactive ticket, depending on feedback from #2326's reporter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/bencode.c

    r8903 r9032  
    13401340                    UTF32 *      u32 = &buf;
    13411341                    ConversionResult result = ConvertUTF8toUTF32( &tmp, end, &u32, &buf + 1, 0 );
    1342                     if( ( result != conversionOK ) && ( tmp == it ) )
    1343                         ++it; /* it's beyond help; skip it */
    1344                     else {
     1342                    if((( result==conversionOK ) || (result==targetExhausted)) && (tmp!=it)) {
    13451343                        evbuffer_add_printf( data->out, "\\u%04x", (unsigned int)buf );
    13461344                        it = tmp - 1;
Note: See TracChangeset for help on using the changeset viewer.