#1318·hiredis

Bug: missing return value check may cause NULL Pointer Dereference.

Author: MicroMiloCreated Nov 26, 2025Updated Nov 26, 2025

https://github.com/redis/hiredis/blob/e834b57f05871c05f7f13e461b78d20907aa3a02/sds.c#L376-L390

Function sdscatlen calls sdsMakeRoomFor, which may fail due to memory management. So there exists a potential NULL Pointer Dereference if we do check the return value of it.

We should check if s is NULL and then apply the follow-up operations, because the sdslen will dereference s directly.

https://github.com/redis/hiredis/blob/e834b57f05871c05f7f13e461b78d20907aa3a02/sds.c#L875-L898