Fixed some heap buffer overflow
authorJens Steube <jens.steube@gmail.com>
Thu, 14 Jan 2016 19:30:38 +0000 (20:30 +0100)
committerJens Steube <jens.steube@gmail.com>
Thu, 14 Jan 2016 19:30:38 +0000 (20:30 +0100)
src/Makefile
src/oclHashcat.c

index c1242a6..e4f8ae9 100644 (file)
@@ -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
index 327ffbc..d1c0603 100644 (file)
@@ -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;