[PATCH 15/65] fix possible out of bounds with empty string ""

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Wed, 16 Apr 2014 19:47:54 +0200

Signed-off-by: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
---
 ii.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ii.c b/ii.c
index ef145a2..768cc00 100644
--- a/ii.c
+++ b/ii.c
_AT_@ -67,7 +67,7 @@ create_dirtree(const char *dir) {
 
 	strlcpy(tmp, dir, sizeof(tmp));
 	len = strnlen(tmp, sizeof(tmp));
-	if(tmp[len - 1] == '/')
+	if(len > 0 && tmp[len - 1] == '/')
 		tmp[len - 1] = 0;
 	for(p = tmp + 1; *p; p++)
 		if(*p == '/') {
-- 
2.4.10
--Multipart=_Mon__9_May_2016_17_21_10_+0200_I.6cpFVydhq75aaE
Content-Type: text/x-diff;
 name="0016-ii.1-show-version-in-man-page.patch"
Content-Disposition: attachment;
 filename="0016-ii.1-show-version-in-man-page.patch"
Content-Transfer-Encoding: 7bit
Received on Mon Sep 17 2001 - 00:00:00 CEST

This archive was generated by hypermail 2.3.0 : Mon May 09 2016 - 17:24:22 CEST