Skip to content

Commit 70c65d2

Browse files
committed
off by one in out of bounds calculations (Jan Kaluza)
1 parent 8e44ed8 commit 70c65d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/softmagic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include "file.h"
3333

3434
#ifndef lint
35-
FILE_RCSID("@(#)$File: softmagic.c,v 1.176 2014/02/18 17:59:21 kim Exp $")
35+
FILE_RCSID("@(#)$File: softmagic.c,v 1.177 2014/02/21 14:32:48 christos Exp $")
3636
#endif /* lint */
3737

3838
#include "magic.h"
@@ -72,7 +72,7 @@ private void cvt_16(union VALUETYPE *, const struct magic *);
7272
private void cvt_32(union VALUETYPE *, const struct magic *);
7373
private void cvt_64(union VALUETYPE *, const struct magic *);
7474

75-
#define OFFSET_OOB(n, o, i) ((n) < (o) || (i) >= ((n) - (o)))
75+
#define OFFSET_OOB(n, o, i) ((n) < (o) || (i) > ((n) - (o)))
7676
/*
7777
* softmagic - lookup one file in parsed, in-memory copy of database
7878
* Passed the name and FILE * of one file to be typed.

0 commit comments

Comments
 (0)