skystrife / procxx

A simple process management library for C++ on UNIX platforms.
MIT License
142 stars 28 forks source link

Comparison between signed and unsigned integer expressions #8

Open funktioniert opened 8 years ago

funktioniert commented 8 years ago

https://github.com/skystrife/procxx/blob/441b5c58d5e56d610670a7c3f0303c0f4aca406b/include/process.h#L284 contains an comparison between signed and unsigned integer expressions.

This could potentially lead to an integer underflow, resulting in memmoving a large area. Maybe add a test for area < 0?

ztdwu commented 8 years ago

Yes, we could have that error if egptr() - dest < 0, although I don't think that will ever happen looking at the code. Still, it would be nice to explicitly cast all signed/unsigned comparisons just for the peace of mind.