Rev 350: handle corrupt ctdb packets better in http://samba.org/~tridge/ctdb

tridge at samba.org tridge at samba.org
Sat May 26 04:46:12 GMT 2007


------------------------------------------------------------
revno: 350
revision-id: tridge at samba.org-20070526044612-v0alyob7oxnvdun3
parent: tridge at samba.org-20070526040108-o5vdpfl6tel9ojku
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge
timestamp: Sat 2007-05-26 14:46:12 +1000
message:
  handle corrupt ctdb packets better
modified:
  common/ctdb_io.c               ctdb_io.c-20070409200335-dzfc7f3rra5rcf60-1
=== modified file 'common/ctdb_io.c'
--- a/common/ctdb_io.c	2007-05-15 04:08:58 +0000
+++ b/common/ctdb_io.c	2007-05-26 04:46:12 +0000
@@ -109,6 +109,11 @@
 		uint8_t *d2;
 		uint32_t len;
 		len = *(uint32_t *)data;
+		if (len == 0) {
+			/* bad packet! treat as EOF */
+			DEBUG(0,("Invalid packet of length 0\n"));
+			goto failed;
+		}
 		d2 = talloc_memdup(queue, data, len);
 		if (d2 == NULL) {
 			DEBUG(0,("read error memdup failed for %u\n", len));



More information about the samba-cvs mailing list