Changeset 6f55bec for lib


Ignore:
Timestamp:
2012-09-23T23:25:32Z (7 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
2a6da96
Parents:
a07a8c2
Message:

xt_from_string() will return NULL if the string wasn't terminated properly.
Adding an extra layer of defense against truncated responses from Twitter.
But as long as the response from xt_from_string() isn't NULL-checked this
won't help much. So that's my next step. :-)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/xmltree.c

    ra07a8c2 r6f55bec  
    266266{
    267267        struct xt_parser *parser;
    268         struct xt_node *ret;
     268        struct xt_node *ret = NULL;
    269269       
    270270        if( len == 0 )
     
    273273        parser = xt_new( NULL, NULL );
    274274        xt_feed( parser, in, len );
    275         ret = parser->root;
    276         parser->root = NULL;
     275        if( parser->cur == NULL )
     276        {
     277                ret = parser->root;
     278                parser->root = NULL;
     279        }
    277280        xt_free( parser );
    278281       
Note: See TracChangeset for help on using the changeset viewer.