[Toybox] llist_traverse() and dirtree_path()

Ashwini Sharma ak.ashwini at gmail.com
Mon Jul 16 22:14:19 PDT 2012


Hi Rob,

 You have modified llist_free to llist_traverse().

In llist_traverse()

while (list) {
        void *pop = llist_pop(&list);
        using(pop);

        // End doubly linked list too.
        if (list==pop) break;
    }

'using' is used without checking it. This is potential crash, if NULL
is passed to llist_tarverse().

I do understand that, why should someone make a call to traverse, if
not wanting to use the elements. But for a safe programming, I think
checking the variable would be better.

For dirtree_path(), I had requested you earlier also, can we modify
the '/' appending logic to append the '/' only in case its not there
at the end else its fine.
Like,
if (len) {
        if(path[len -1] != '/') path[len++]='/';
    }

please do let me know your opinion.

-Ashwini

 1342502059.0


More information about the Toybox mailing list