From 7bfee268d41a484c37e9f194f9a4db9817b15f21 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Thu, 14 Jan 2016 20:30:38 +0100 Subject: [PATCH] Fixed some heap buffer overflow --- src/Makefile | 2 +- src/oclHashcat.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index c1242a6..e4f8ae9 100644 --- a/src/Makefile +++ b/src/Makefile @@ -77,7 +77,7 @@ NOW := $(shell date +%s) ## CFLAGS := -O2 -s -pipe -W -Wall -std=c99 -Iinclude/ -#CFLAGS := -g -pipe -W -Wall -std=c99 -Iinclude/ +#CFLAGS := -g -ggdb -pipe -W -Wall -std=c99 -Iinclude/ -fsanitize=address ## ## Native compilation target diff --git a/src/oclHashcat.c b/src/oclHashcat.c index 327ffbc..d1c0603 100644 --- a/src/oclHashcat.c +++ b/src/oclHashcat.c @@ -1729,7 +1729,7 @@ static uint count_lines (FILE *fd) { uint cnt = 0; - char *buf = (char *) mymalloc (BUFSIZ); + char *buf = (char *) mymalloc (BUFSIZ + 1); size_t nread_tmp = 0; -- 2.25.1