mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-22 06:07:39 +00:00
Check for NULL before passing it to vsnprintf
This commit is contained in:
parent
6b05240cea
commit
183aa4f831
@ -1144,7 +1144,7 @@ int git_config_parse_int64(int64_t *out, const char *value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
fail_parse:
|
fail_parse:
|
||||||
giterr_set(GITERR_CONFIG, "Failed to parse '%s' as an integer", value);
|
giterr_set(GITERR_CONFIG, "Failed to parse '%s' as an integer", value ? value : "(null)");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1164,7 +1164,7 @@ int git_config_parse_int32(int32_t *out, const char *value)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail_parse:
|
fail_parse:
|
||||||
giterr_set(GITERR_CONFIG, "Failed to parse '%s' as a 32-bit integer", value);
|
giterr_set(GITERR_CONFIG, "Failed to parse '%s' as a 32-bit integer", value ? value : "(null)");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ static int ensure_remote_name_is_valid(const char *name)
|
|||||||
if (!git_remote_is_valid_name(name)) {
|
if (!git_remote_is_valid_name(name)) {
|
||||||
giterr_set(
|
giterr_set(
|
||||||
GITERR_CONFIG,
|
GITERR_CONFIG,
|
||||||
"'%s' is not a valid remote name.", name);
|
"'%s' is not a valid remote name.", name ? name : "(null)");
|
||||||
error = GIT_EINVALIDSPEC;
|
error = GIT_EINVALIDSPEC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user