summaryrefslogtreecommitdiff
path: root/src/common/leb128.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2010-06-14 23:39:03 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2010-06-14 23:39:03 (GMT)
commit1e2aada1204d3da43fe075478df5bfaaece937b0 (patch)
tree99eb321808ddcc0364928adf9266f32a201d2b59 /src/common/leb128.c
parentaf7d2ea327d27200ad151d3e1ba0ee6d51b1ff62 (diff)
Made the program stronger by handling more errors.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@167 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/common/leb128.c')
-rw-r--r--src/common/leb128.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/leb128.c b/src/common/leb128.c
index 4a03797..1b65fa7 100644
--- a/src/common/leb128.c
+++ b/src/common/leb128.c
@@ -45,6 +45,8 @@ bool read_uleb128(uleb128_t *target, const bin_t *data, off_t *pos, off_t len)
int shift; /* Décallage à appliquer */
off_t i; /* Boucle de parcours */
+ if (*pos < 0) return false;
+
shift = 0;
*target = 0;
@@ -87,6 +89,8 @@ bool read_leb128(leb128_t *target, const bin_t *data, off_t *pos, off_t len)
int shift; /* Décallage à appliquer */
off_t i; /* Boucle de parcours */
+ if (*pos < 0) return false;
+
shift = 0;
*target = 0;