NagiosEnterprises / nrpe

NRPE Agent
GNU General Public License v2.0
263 stars 134 forks source link

Check nrpe fix #228

Closed andreasbaumann closed 4 years ago

andreasbaumann commented 4 years ago

Code should be checked again against packet buffer operations, is it with terminating '\0' or not, what's it's exact size?

The tot_bytes case is not severe (fixed on-passant), as the result (being 10 in case of SSL) is never used afterwards.

Also calling SSL_read with 0 bytes to read is maybe not the best idea, better check for bytes_to_read >0 before calling the SSL_read function.

Experienced problems on IA-32 (Archlinux32) and Archlinux (armv7, RaspPi 2).

In armv7 I also got a linked list corruption in SSL_free when read_packet was called twice (in case of a protocol fallback).

sawolf commented 4 years ago

These changes look good to me.

To be completely honest, I don't think we've ever tested NRPE on non-x86 processors (nor do I know of any that we keep in the office).

andreasbaumann commented 4 years ago

np. I might have triggered a rare usage case, running the moniroting station on a Raspberry Pi II, just to switch to an Alix IA-32 applicance, to hit the bug again. :-) But the array bounds write is also there when using valgrind on x86_64..