The check `start + res < start' is broken since pointer overflow is undefined behavior in C. Many compilers such as gcc/clang optimize away this check. Use `res > end - start' instead. Also change `res' to unsigned int to avoid signed left-shift overflow. Signed-off-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>pull/28/head^2
parent
ecb918e5f0
commit
cf29f49d8a
1 changed files with 2 additions and 2 deletions
Loading…
Reference in new issue