libnfs
libnfs copied to clipboard
few vulnerabilities
Here malicious packet can lead to suprises. (depending on size of int, etc)
Here we will end up allocating too few bytes if size is (uint32_t)-1 (or close) due to wraparound. Same effect.
Same here. That cast to int is bad.
And in general code is vulnerable to effects related to overflows. For example, this code:
if (zdrs->pos + 8 > zdrs->size) {
should be written as:
if (zdrs->size - zdrs->pos < 8) { // not vulnerable to wraparounds anymore
and etc.