summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5e9677c)
raw | patch | inline | side by side (parent: 5e9677c)
author | Erik Faye-Lund <kusmabite@gmail.com> | |
Thu, 23 Sep 2010 17:35:25 +0000 (17:35 +0000) | ||
committer | Pat Thoyts <patthoyts@users.sourceforge.net> | |
Sun, 3 Oct 2010 22:34:02 +0000 (23:34 +0100) |
fetch_and_setup_pack_index() apparently pass a NULL-pointer to
parse_pack_index(), which in turn pass it to check_packed_git_idx(),
which again pass it to open(). Since open() already sets errno
correctly for the NULL-case, let's just avoid the problematic strcmp.
[PT: squashed in fix for fopen which was missed first time round]
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
parse_pack_index(), which in turn pass it to check_packed_git_idx(),
which again pass it to open(). Since open() already sets errno
correctly for the NULL-case, let's just avoid the problematic strcmp.
[PT: squashed in fix for fopen which was missed first time round]
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
compat/mingw.c | patch | blob | history |
diff --git a/compat/mingw.c b/compat/mingw.c
index 431e32265d63028a998c8cdd88af12ec1871e63a..bd1403a1d510aa35f9e5e32f762ac519e1b6b176 100644 (file)
--- a/compat/mingw.c
+++ b/compat/mingw.c
mode = va_arg(args, int);
va_end(args);
- if (!strcmp(filename, "/dev/null"))
+ if (filename && !strcmp(filename, "/dev/null"))
filename = "nul";
fd = open(filename, oflags, mode);
#undef fopen
FILE *mingw_fopen (const char *filename, const char *otype)
{
- if (!strcmp(filename, "/dev/null"))
+ if (filename && !strcmp(filename, "/dev/null"))
filename = "nul";
return fopen(filename, otype);
}