mirror of
https://github.com/mdbtools/mdbtools.git
synced 2026-02-25 21:26:41 +08:00
Fix infinite loop (See oss-fuzz/28789)
A loop is still possible with mutually referencing pages but eliminating self-references should fix the major timeouts
This commit is contained in:
@@ -411,6 +411,8 @@ int mdb_read_next_dpg(MdbTableDef *table)
|
|||||||
break; /* unknow map type: goto fallback */
|
break; /* unknow map type: goto fallback */
|
||||||
if (!next_pg)
|
if (!next_pg)
|
||||||
return 0;
|
return 0;
|
||||||
|
if ((guint32)next_pg == table->cur_phys_pg)
|
||||||
|
return 0; /* Infinite loop */
|
||||||
|
|
||||||
if (!mdb_read_pg(mdb, next_pg)) {
|
if (!mdb_read_pg(mdb, next_pg)) {
|
||||||
fprintf(stderr, "error: reading page %d failed.\n", next_pg);
|
fprintf(stderr, "error: reading page %d failed.\n", next_pg);
|
||||||
|
|||||||
Reference in New Issue
Block a user