aboutsummaryrefslogtreecommitdiff
Fix CVE-2017-7853:

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-7853
https://savannah.gnu.org/support/index.php?109265

Patch copied from upstream source repository:

https://git.savannah.gnu.org/cgit/osip.git/commit/?id=1ae06daf3b2375c34af23083394a6f010be24a45

From 1ae06daf3b2375c34af23083394a6f010be24a45 Mon Sep 17 00:00:00 2001
From: Aymeric Moizard <amoizard@gmail.com>
Date: Tue, 21 Feb 2017 17:16:26 +0100
Subject: [PATCH]  * fix bug report: sr #109265: SIP message body length
 underflow in libosip2-4.1.0    https://savannah.gnu.org/support/?109265   
 also applicable to current latest version

---
 src/osipparser2/osip_message_parse.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/osipparser2/osip_message_parse.c b/src/osipparser2/osip_message_parse.c
index 1628c60..aa35446 100644
--- a/src/osipparser2/osip_message_parse.c
+++ b/src/osipparser2/osip_message_parse.c
@@ -784,6 +784,12 @@ msg_osip_body_parse (osip_message_t * sip, const char *start_of_buf, const char
     if ('\n' == start_of_body[0] || '\r' == start_of_body[0])
       start_of_body++;
 
+    /* if message body is empty or contains a single CR/LF */
+    if (end_of_body <= start_of_body) {
+      osip_free (sep_boundary);
+      return OSIP_SYNTAXERROR;
+    }
+
     body_len = end_of_body - start_of_body;
 
     /* Skip CR before end boundary. */
-- 
2.13.1

an>Correct name and email address for ng0....ng0 2019-01-21Update .mailmap....Mathieu Othacehe 2018-08-27Update email for Pierre Neidhardt....Pierre Neidhardt 2018-07-16mailmap: Add a line for Pierre-Antoine....Ludovic Courtès 2018-07-16mailmap: Add another line for myself....Nils Gillmann 2018-03-20Correct name and Email for ng0....ng0 2018-02-11mailmap: Adjust entries for ng0....ng0 2017-11-26Update e-mail for ng0....ng0 2017-10-03Update e-mail for Theodoros Foradis....Theodoros Foradis 2017-08-29Update e-mail for Kei Kebreau....Kei Kebreau 2017-08-13mailmap: fix entries for ng0....ng0 2017-06-16mailmap: Adjust entries for ng0....ng0 2017-06-03.mailmap: Add another alias for ng0....ng0 2017-05-23mailmap: Update entries for Adriano Peluso...Adriano Peluso 2017-05-22mailmap: Add an entry for Mathieu Othacehe....Mathieu Othacehe 2017-04-20mailmap: Update entries for ng0....ng0 2017-01-27Update .mailmap entries for ng0....ng0 2017-01-01Update .mailmap....Alex Kost 2016-12-20mailmap: Add alias for Marius Bakke....Marius Bakke 2016-11-26mailmap: Associate all commits by ng0 with ng0....ng0 2016-10-11Update e-mail address for ng0....ng0 2016-10-05Update e-mail address for ng0....ng0 2016-07-15Update e-mail address for Tobias Geerinckx-Rice....Andreas Enge 2016-07-03Update name for ng0....ng0 2016-05-19Update name for Kei Kebreau....Kei Kebreau 2016-05-04Update .mailmap....Alex Kost