Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP1
qemu-linux-user.19805
0177-slirp-ensure-there-is-enough-space-.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0177-slirp-ensure-there-is-enough-space-.patch of Package qemu-linux-user.19805
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com> Date: Fri, 3 May 2019 13:32:04 +0200 Subject: slirp: ensure there is enough space in mbuf to null-terminate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prevents from buffer overflows. Related to: https://bugzilla.redhat.com/show_bug.cgi?id=1664205 Cc: Prasad J Pandit <pjp@fedoraproject.org> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> [BFR: In support of BSC#1123156] Signed-off-by: Bruce Rogers <brogers@suse.com> --- slirp/tcp_subr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c index e6924d28bae6fedac9617394f272..95181f6701dd2bf4318c73fe87ca 100644 --- a/slirp/tcp_subr.c +++ b/slirp/tcp_subr.c @@ -645,6 +645,7 @@ tcp_emu(struct socket *so, struct mbuf *m) memcpy(so_rcv->sb_wptr, m->m_data, m->m_len); so_rcv->sb_wptr += m->m_len; so_rcv->sb_rptr += m->m_len; + m_inc(m, m->m_len + 1); m->m_data[m->m_len] = 0; /* NULL terminate */ if (strchr(m->m_data, '\r') || strchr(m->m_data, '\n')) { if (sscanf(so_rcv->sb_data, "%u%*[ ,]%u", &n1, &n2) == 2) { @@ -678,6 +679,7 @@ tcp_emu(struct socket *so, struct mbuf *m) } case EMU_FTP: /* ftp */ + m_inc(m, m->m_len + 1); *(m->m_data+m->m_len) = 0; /* NUL terminate for strstr */ if ((bptr = (char *)strstr(m->m_data, "ORT")) != NULL) { /* @@ -775,6 +777,7 @@ tcp_emu(struct socket *so, struct mbuf *m) /* * Need to emulate DCC CHAT, DCC SEND and DCC MOVE */ + m_inc(m, m->m_len + 1); *(m->m_data+m->m_len) = 0; /* NULL terminate the string for strstr */ if ((bptr = (char *)strstr(m->m_data, "DCC")) == NULL) return 1;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor