[PATCH 33/34] column: dereference of null pointer [clang-analyzer]

Sami Kerola
2013-07-07T19:56:41Z

text-utils/column.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/text-utils/column.c b/text-utils/column.c
index 25a2286..3909887 100644
--- a/text-utils/column.c
+++ b/text-utils/column.c
@@ -392,7 +392,7 @@ static int input(FILE *fp, int *maxlength, wchar_t ***list, int *entries)
continue;
}
lineno++;
- if (!feof(fp))
+ if (!feof(fp) && p)
*p = '\0';
len = wcs_width(buf); /* len = p - buf; */
if (*maxlength < len)
--
1.8.3.2