<<< Date Index >>>     <<< Thread Index >>>

RFC: PATCH: fix size_t/int confusion in mutt_socket_readln_d



Greetings,

I'm reviewing random compiler warnings.

mutt_socket_readln_d() gets size_t buflen as argument, but uses int as iterator variable. There is a mismatch because int can never hold as much as the unsigned size_t type, and there may be additional mismatches between 32-bit int and 64-bit size_t.

How about the attached patch to prevent integer overflow?

Or should this make the iterator an ssize_t and make sure it doesn't wrap?

Best regards

--
Matthias Andree

Attachment: patch-mutt_socket_readln_d.diff
Description: Binary data