Considering the following fallback case :

After skimming the code a little more I came to this for the above case(i.e. src->s is NULL):

I'd go for the second option. What do you think?

Also I've seen that the memory manager allocate and 'unsigned int'. So, if shm/pkg_str_dup() is called with src->len < 0 it will probably fail (depending on the negative value). In this case, I'd also force the fallback case.


Reply to this email directly or view it on GitHub.