Skip to content

Commit 5405964

Browse files
authored
Fix issue 884 (VirusTotal#887)
The yr_compiler_add_fd was reading only the first 1024 bytes of the file.
1 parent cffc627 commit 5405964

File tree

6 files changed

+181
-122
lines changed

6 files changed

+181
-122
lines changed

libyara/compiler.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,6 +1159,13 @@ YR_API char* yr_compiler_get_error_message(
11591159
buffer_size,
11601160
"integer overflow in \"%s\"",
11611161
compiler->last_error_extra_info);
1162+
break;
1163+
case ERROR_COULD_NOT_READ_FILE:
1164+
snprintf(
1165+
buffer,
1166+
buffer_size,
1167+
"could not read file");
1168+
break;
11621169
}
11631170

11641171
return buffer;

libyara/include/yara/error.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9797
#define ERROR_INTEGER_OVERFLOW 52
9898
#define ERROR_CALLBACK_REQUIRED 53
9999
#define ERROR_INVALID_OPERAND 54
100+
#define ERROR_COULD_NOT_READ_FILE 55
100101

101102

102103
#define FAIL_ON_ERROR(x) { \

0 commit comments

Comments
 (0)