use size_t
When dealing with in-memory lengths, the standard type "size_t" should be used. Missing one can be quite dangerous, because an attacker could provoke an integer under-/overflow, which may provide an attack vector. git-svn-id: https://svn.musicpd.org/mpd/trunk@7205 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:

committed by
Eric Wong

parent
0692f6cd0a
commit
27f12c173d
@@ -30,7 +30,7 @@ static void blockingWrite(const int fd, const char *string, size_t len)
|
||||
{
|
||||
while (len) {
|
||||
ssize_t ret = xwrite(fd, string, len);
|
||||
if (ret == len)
|
||||
if (ret == (ssize_t)len)
|
||||
return;
|
||||
if (ret >= 0) {
|
||||
len -= ret;
|
||||
|
Reference in New Issue
Block a user