d8307d
commit 61595e3d36ded374f97961503e843a314b0203c2
d8307d
Author: Andreas Schwab <schwab@suse.de>
d8307d
Date:   Tue May 15 14:42:37 2018 +0200
d8307d
d8307d
    nscd: avoid assertion failure during persistent db check
d8307d
    
d8307d
    nscd should not abort when it finds inconsistencies in the persistent db.
d8307d
d8307d
diff --git a/nscd/connections.c b/nscd/connections.c
d8307d
index 47fbb9923aa2aac7..98182007646a33d5 100644
d8307d
--- a/nscd/connections.c
d8307d
+++ b/nscd/connections.c
d8307d
@@ -304,7 +304,8 @@ static int
d8307d
 check_use (const char *data, nscd_ssize_t first_free, uint8_t *usemap,
d8307d
 	   enum usekey use, ref_t start, size_t len)
d8307d
 {
d8307d
-  assert (len >= 2);
d8307d
+  if (len < 2)
d8307d
+    return 0;
d8307d
 
d8307d
   if (start > first_free || start + len > first_free
d8307d
       || (start & BLOCK_ALIGN_M1))