Mercurial > pidgin
changeset 9839:96e98bb4ded5
[gaim-migrate @ 10716]
Mike Stoddard acted fast to provide a requested patch
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Mon, 23 Aug 2004 18:55:36 +0000 |
parents | ad7fab671e6f |
children | e8caffe42e38 |
files | src/protocols/novell/nmevent.c |
diffstat | 1 files changed, 28 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/protocols/novell/nmevent.c Mon Aug 23 05:17:59 2004 +0000 +++ b/src/protocols/novell/nmevent.c Mon Aug 23 18:55:36 2004 +0000 @@ -27,6 +27,8 @@ #include "nmuserrecord.h" #include "nmrtf.h" +#define MAX_UINT32 0xFFFFFFFF + struct _NMEvent { @@ -147,6 +149,8 @@ /* Read the conference guid */ rc = nm_read_uint32(conn, &size); + if (size == MAX_UINT32) return NMERR_PROTOCOL; + if (rc == NM_OK) { guid = g_new0(char, size + 1); rc = nm_read_all(conn, guid, size); @@ -160,8 +164,9 @@ /* Read the message text */ if (rc == NM_OK) { rc = nm_read_uint32(conn, &size); + if (size == MAX_UINT32) return NMERR_PROTOCOL; + if (rc == NM_OK) { - msg = g_new0(char, size + 1); rc = nm_read_all(conn, msg, size); @@ -265,6 +270,8 @@ /* Read the conference guid */ rc = nm_read_uint32(conn, &size); + if (size == MAX_UINT32) return NMERR_PROTOCOL; + if (rc == NM_OK) { guid = g_new0(char, size + 1); rc = nm_read_all(conn, guid, size); @@ -273,6 +280,8 @@ /* Read the the message */ if (rc == NM_OK) { rc = nm_read_uint32(conn, &size); + if (size == MAX_UINT32) return NMERR_PROTOCOL; + if (rc == NM_OK) { msg = g_new0(char, size + 1); rc = nm_read_all(conn, msg, size); @@ -340,6 +349,8 @@ /* Read the conference guid */ rc = nm_read_uint32(conn, &size); + if (size == MAX_UINT32) return NMERR_PROTOCOL; + if (rc == NM_OK) { guid = g_new0(char, size + 1); rc = nm_read_all(conn, guid, size); @@ -390,6 +401,8 @@ /* Read the conference guid */ rc = nm_read_uint32(conn, &size); + if (size == MAX_UINT32) return NMERR_PROTOCOL; + if (rc == NM_OK) { guid = g_new0(char, size + 1); rc = nm_read_all(conn, guid, size); @@ -427,6 +440,8 @@ /* Read the conference guid */ rc = nm_read_uint32(conn, &size); + if (size == MAX_UINT32) return NMERR_PROTOCOL; + if (rc == NM_OK) { guid = g_new0(char, size + 1); rc = nm_read_all(conn, guid, size); @@ -475,6 +490,8 @@ /* Read the conference guid */ rc = nm_read_uint32(conn, &size); + if (size == MAX_UINT32) return NMERR_PROTOCOL; + if (rc == NM_OK) { guid = g_new0(char, size + 1); rc = nm_read_all(conn, guid, size); @@ -513,6 +530,8 @@ /* Read the conference guid */ rc = nm_read_uint32(conn, &size); + if (size == MAX_UINT32) return NMERR_PROTOCOL; + if (rc == NM_OK) { guid = g_new0(char, size + 1); rc = nm_read_all(conn, guid, size); @@ -570,6 +589,8 @@ /* Read the conference guid */ rc = nm_read_uint32(conn, &size); + if (size == MAX_UINT32) return NMERR_PROTOCOL; + if (rc == NM_OK) { guid = g_new0(char, size + 1); rc = nm_read_all(conn, guid, size); @@ -611,11 +632,11 @@ /* Read the status text */ rc = nm_read_uint32(conn, &size); + if (size == MAX_UINT32) return NMERR_PROTOCOL; + if (rc == NM_OK) { - if (size > 0) { - text = g_new0(char, size + 1); - rc = nm_read_all(conn, text, size); - } + text = g_new0(char, size + 1); + rc = nm_read_all(conn, text, size); } } @@ -649,6 +670,8 @@ /* Read the conference guid */ rc = nm_read_uint32(conn, &size); + if (size == MAX_UINT32) return NMERR_PROTOCOL; + if (rc == NM_OK) { guid = g_new0(char, size + 1); rc = nm_read_all(conn, guid, size);