Are these for safety reasons or have you found specific cases in other parts of code affected by not having this checks?

One comment I have is about the str dup functions, when the new check on len==0 results in setting dst s to NULL. Specs for malloc(0) are not very strict, saying that it can return a valid pointer for free(). However, the free(0) should not be done. With kamailio memory managers, pkg/shm malloc 0 returns a pointer of size(void*).

I think would be ok to set dst s to null if src s is null, but if src len is 0 and src s is not null, maybe is better to allocate it...

These are some thoughts, perhaps a deeper review where these str dup functions are used should be done.


Reply to this email directly or view it on GitHub.