diff mbox

[btrfs-progs] Prevent a SIGSEGV by returning -1 from btrfs_search_slot()

Message ID 1282210136-3625-1-git-send-email-surbhi.palande@canonical.com (mailing list archive)
State New, archived
Headers show

Commit Message

Surbhi Palande Aug. 19, 2010, 9:28 a.m. UTC
None
diff mbox

Patch

diff --git a/ctree.c b/ctree.c
index f70e10c..8ec7bf8 100644
--- a/ctree.c
+++ b/ctree.c
@@ -1264,6 +1264,9 @@  again:
 						 key->objectid);
 
 			b = read_node_slot(root, b, slot);
+			if (!b) {
+				return -1;	
+			}
 		} else {
 			p->slots[level] = slot;
 			if (ins_len > 0 &&