#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: softmagic.c,v 1.156 2013/01/03 23:11:38 christos Exp $")
+FILE_RCSID("@(#)$File: softmagic.c,v 1.157 2013/01/04 16:37:54 christos Exp $")
#endif /* lint */
#include "magic.h"
if (type == FILE_BESTRING16)
src++;
- /* check for pointer overflow */
- if (src < s) {
+ /* check that offset is within range */
+ if (offset >= nbytes) {
file_magerror(ms, "invalid offset %u in mcopy()",
offset);
return -1;