openresty / lua-cjson

Lua CJSON is a fast JSON encoding/parsing module for Lua
http://www.kyne.com.au/~mark/software/lua-cjson.php
MIT License
434 stars 119 forks source link

bugfix: fixed a possible division by zero bug found by cppcheck. #75

Closed xiaocang closed 3 years ago

xiaocang commented 3 years ago

strbuf.c:155:49: warning: Either the condition 's->increment<0' is redundant or there is division by zero at line 155. [zerodivcond] newsize = ((newsize + s->increment - 1) / s->increment) * s->increment;