/pidgin/main: dfe26ea283ee: Clean merge.
Mark Doliner
mark at kingant.net
Tue Jan 28 10:38:11 EST 2014
Changeset: dfe26ea283ee9bd9ca751deca8a2335c8a12038e
Author: Mark Doliner <mark at kingant.net>
Date: 2014-01-11 21:43 -0800
Branch: release-2.x.y
URL: https://hg.pidgin.im/pidgin/main/rev/dfe26ea283ee
Description:
Clean merge.
diffstat:
libpurple/protocols/simple/simple.c | 2 +-
libpurple/protocols/simple/sipmsg.c | 5 +++++
2 files changed, 6 insertions(+), 1 deletions(-)
diffs (27 lines):
diff --git a/libpurple/protocols/simple/simple.c b/libpurple/protocols/simple/simple.c
--- a/libpurple/protocols/simple/simple.c
+++ b/libpurple/protocols/simple/simple.c
@@ -1640,7 +1640,7 @@ static void process_input(struct simple_
cur += 2;
restlen = conn->inbufused - (cur - conn->inbuf);
if(restlen >= msg->bodylen) {
- dummy = g_malloc(msg->bodylen + 1);
+ dummy = g_new(char, msg->bodylen + 1);
memcpy(dummy, cur, msg->bodylen);
dummy[msg->bodylen] = '\0';
msg->body = dummy;
diff --git a/libpurple/protocols/simple/sipmsg.c b/libpurple/protocols/simple/sipmsg.c
--- a/libpurple/protocols/simple/sipmsg.c
+++ b/libpurple/protocols/simple/sipmsg.c
@@ -114,6 +114,11 @@ struct sipmsg *sipmsg_parse_header(const
tmp2 = sipmsg_find_header(msg, "Content-Length");
if (tmp2 != NULL)
msg->bodylen = strtol(tmp2, NULL, 10);
+ if (msg->bodylen < 0) {
+ purple_debug_warning("simple", "Invalid body length: %d",
+ msg->bodylen);
+ msg->bodylen = 0;
+ }
if(msg->response) {
tmp2 = sipmsg_find_header(msg, "CSeq");
More information about the Commits
mailing list