From: adam Date: Wed, 24 Jul 2013 19:13:40 +0000 (+0700) Subject: i32 overflow checking X-Git-Tag: v1.2.12~249 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=131aea64294c498d25d270c455baabf0f295941c;p=platform%2Fupstream%2Fejdb.git i32 overflow checking in the wake of http://jira.incubaid.com/browse/ARAKOON-373 --- diff --git a/tcejdb/tcbmgr.c b/tcejdb/tcbmgr.c index 5530d27..d99fab0 100644 --- a/tcejdb/tcbmgr.c +++ b/tcejdb/tcbmgr.c @@ -985,6 +985,10 @@ static int procimporttsv(const char *path, const char *file, int omode, bool sc) cnt++; } printf(" (%08d)\n", cnt); + if (!tcbdbsync(bdb)) { + printerr(bdb); + err = true; + } if (!tcbdbclose(bdb)) { if (!err) printerr(bdb); err = true; diff --git a/tcejdb/tchdb.c b/tcejdb/tchdb.c index b0f6b0b..b4e2632 100644 --- a/tcejdb/tchdb.c +++ b/tcejdb/tchdb.c @@ -2806,6 +2806,9 @@ static bool tchdbfbpsearch(TCHDB *hdb, TCHREC *rec) { The return value is whether splicing succeeded or not. */ static bool tchdbfbpsplice(TCHDB *hdb, TCHREC *rec, uint32_t nsiz) { assert(hdb && rec && nsiz > 0); + if (nsiz > (0x80000000 - hdb->align)) { + return false; + } if (hdb->mmtx) { if (hdb->fbpnum < 1) { return false;