antirez / sds

Simple Dynamic Strings library for C
BSD 2-Clause "Simplified" License
4.93k stars 480 forks source link

Potential integer overflow in sds.c #150

Open Crispy-fried-chicken opened 9 months ago

Crispy-fried-chicken commented 9 months ago

The sdsnewlen and sdsMakeRoomFor function implemented in sds.c is quite similiar to those in the redis. Thus, it's very likely that this integer overflow in CVE-2021-21309 also affects sds. Would you can help to check if this bug is true? If it's true, I'd like to open a PR for that if necessary. Thank you for your effort and patience! And here is the patch for CVE-2021-21309 for your reference if this issue needs to be fixed.