Index: third_party/sqlite/src/src/recover.c |
diff --git a/third_party/sqlite/src/src/recover.c b/third_party/sqlite/src/src/recover.c |
index 8e3929d453be4db35ebe8468185e54905485f667..58dd89e1f2f6f9011b028137acccd5a27e7525b8 100644 |
--- a/third_party/sqlite/src/src/recover.c |
+++ b/third_party/sqlite/src/src/recover.c |
@@ -1138,6 +1138,7 @@ struct RecoverLeafCursor { |
*/ |
static int leafCursorLoadPage(RecoverLeafCursor *pCursor, DbPage *pPage){ |
const unsigned char *pPageHeader; /* Header of *pPage */ |
+ unsigned nCells; /* Number of cells in the page */ |
/* Release the current page. */ |
if( pCursor->pPage ){ |
@@ -1167,10 +1168,17 @@ static int leafCursorLoadPage(RecoverLeafCursor *pCursor, DbPage *pPage){ |
return SQLITE_OK; |
} |
+ /* Leaf contains no data, skip it. Empty tables, for instance. */ |
+ nCells = decodeUnsigned16(pPageHeader + kiPageCellCountOffset);; |
+ if( nCells<1 ){ |
Ryan Hamilton
2016/02/05 17:51:25
The style... it burns my eyes!
Scott Hess - ex-Googler
2016/02/05 18:18:05
Yeah! It's essentially opposite Google/Chromium s
|
+ sqlite3PagerUnref(pPage); |
+ return SQLITE_OK; |
+ } |
+ |
/* Take ownership of the page and start decoding. */ |
pCursor->pPage = pPage; |
pCursor->iCell = 0; |
- pCursor->nCells = decodeUnsigned16(pPageHeader + kiPageCellCountOffset); |
+ pCursor->nCells = nCells; |
return SQLITE_OK; |
} |
Ryan Hamilton
2016/02/05 17:51:25
This diff appears to be basically the same as the
Scott Hess - ex-Googler
2016/02/05 18:18:05
Oh, sorry, should have mentioned that, too.
In th
|