------------------------------------------------------------ revno: 350 revision-id: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] committer: Andrew Tridgell <[EMAIL PROTECTED]> 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));