Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
alxchk committed Oct 9, 2018
1 parent 33b7c7a commit 2479126
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion psutil/_psutil_sunos.c
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,7 @@ psutil_net_connections(PyObject *self, PyObject *args) {
mibhdr.len = 0;
#endif
memcpy(buf, &tor, sizeof tor);
memcpy(buf + sizeof tor, &mibhdr, sizeof mibhdr);
memcpy(buf + tor.OPT_offset, &mibhdr, sizeof mibhdr);

ctlbuf.buf = buf;
ctlbuf.len = tor.OPT_offset + tor.OPT_length;
Expand Down Expand Up @@ -1213,6 +1213,9 @@ psutil_net_connections(PyObject *self, PyObject *args) {
goto error;
}

memset(&mibhdr, 0x0, sizeof(mibhdr));
memcpy(&mibhdr, buf + toa.OPT_offset, toa.OPT_length);

databuf.maxlen = mibhdr.len;
databuf.len = 0;
databuf.buf = (char *)malloc((int)mibhdr.len);
Expand Down

0 comments on commit 2479126

Please sign in to comment.