mirror of
https://github.com/cesanta/mongoose.git
synced 2024-11-28 05:39:00 +08:00
Fix buffer size passed to inet_ntop()
Fixes https://github.com/cesanta/mongoose-os/issues/394 CL: Fix buffer size passed to inet_ntop() PUBLISHED_FROM=4a6702527627ccbb780f45200274b09a28be69ee
This commit is contained in:
parent
a3c4a48ef7
commit
ad8f1d88d4
@ -10093,7 +10093,7 @@ int mg_sock_addr_to_str(const union socket_address *sa, char *buf, size_t len,
|
||||
goto cleanup;
|
||||
}
|
||||
#else
|
||||
if (inet_ntop(AF_INET, (void *) &sa->sin.sin_addr, buf, len - 1) == NULL) {
|
||||
if (inet_ntop(AF_INET, (void *) &sa->sin.sin_addr, buf, len) == NULL) {
|
||||
goto cleanup;
|
||||
}
|
||||
#endif
|
||||
|
@ -144,7 +144,7 @@ int mg_sock_addr_to_str(const union socket_address *sa, char *buf, size_t len,
|
||||
goto cleanup;
|
||||
}
|
||||
#else
|
||||
if (inet_ntop(AF_INET, (void *) &sa->sin.sin_addr, buf, len - 1) == NULL) {
|
||||
if (inet_ntop(AF_INET, (void *) &sa->sin.sin_addr, buf, len) == NULL) {
|
||||
goto cleanup;
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user