Git 2.1.0-rc1
[gitweb.git] / builtin / apply.c
index 9f8f5bac072661adf9b911b091ab4202796e9a9e..be2b4ce2fd91640379b0a65d0aa90238d7edfd64 100644 (file)
@@ -1075,7 +1075,7 @@ static int gitdiff_index(const char *line, struct patch *patch)
 
        line = ptr + 2;
        ptr = strchr(line, ' ');
-       eol = strchr(line, '\n');
+       eol = strchrnul(line, '\n');
 
        if (!ptr || eol < ptr)
                ptr = eol;