Skip to content

Commit

Permalink
mms: fixed buffer overflow bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksiy-Yakovenko committed May 11, 2014
1 parent 7acc533 commit d95b3f2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/mms/libmms/mms.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,11 @@ static int fallback_io_tcp_connect(void *data, const char *host, int port, int *
for (rp = res; rp != NULL; rp = rp->ai_next) {
struct sockaddr_in sin;
memset (&sin, 0, sizeof (sin));
memcpy (&sin, rp->ai_addr, rp->ai_addrlen);
int l = rp->ai_addrlen;
if (l > sizeof (sin)) {
l = sizeof (sin);
}
memcpy (&sin, rp->ai_addr, l);
#endif

time_t t = time (NULL);
Expand Down

0 comments on commit d95b3f2

Please sign in to comment.