Commit cb4bfbc9 by Edward Thomson

buffer: git_buf_sanitize should return a value

`git_buf_sanitize` is called with user-input, and wants to sanity-check
that input.  Allow it to return a value if the input was malformed in a
way that we cannot cope.
parent a6dd5865
...@@ -423,11 +423,12 @@ int git_blob_filter( ...@@ -423,11 +423,12 @@ int git_blob_filter(
GIT_ASSERT_ARG(path); GIT_ASSERT_ARG(path);
GIT_ASSERT_ARG(out); GIT_ASSERT_ARG(out);
git_buf_sanitize(out);
GIT_ERROR_CHECK_VERSION( GIT_ERROR_CHECK_VERSION(
given_opts, GIT_BLOB_FILTER_OPTIONS_VERSION, "git_blob_filter_options"); given_opts, GIT_BLOB_FILTER_OPTIONS_VERSION, "git_blob_filter_options");
if (git_buf_sanitize(out) < 0)
return -1;
if (given_opts != NULL) if (given_opts != NULL)
memcpy(&opts, given_opts, sizeof(git_blob_filter_options)); memcpy(&opts, given_opts, sizeof(git_blob_filter_options));
......
...@@ -417,7 +417,8 @@ int git_branch_upstream_name( ...@@ -417,7 +417,8 @@ int git_branch_upstream_name(
GIT_ASSERT_ARG(out); GIT_ASSERT_ARG(out);
GIT_ASSERT_ARG(refname); GIT_ASSERT_ARG(refname);
git_buf_sanitize(out); if ((error = git_buf_sanitize(out)) < 0)
return error;
if (!git_reference__is_branch(refname)) if (!git_reference__is_branch(refname))
return not_a_local_branch(refname); return not_a_local_branch(refname);
...@@ -478,9 +479,8 @@ int git_branch_upstream_remote(git_buf *buf, git_repository *repo, const char *r ...@@ -478,9 +479,8 @@ int git_branch_upstream_remote(git_buf *buf, git_repository *repo, const char *r
if ((error = git_repository_config__weakptr(&cfg, repo)) < 0) if ((error = git_repository_config__weakptr(&cfg, repo)) < 0)
return error; return error;
git_buf_sanitize(buf); if ((error = git_buf_sanitize(buf)) < 0 ||
(error = retrieve_upstream_configuration(buf, cfg, refname, "branch.%s.remote")) < 0)
if ((error = retrieve_upstream_configuration(buf, cfg, refname, "branch.%s.remote")) < 0)
return error; return error;
if (git_buf_len(buf) == 0) { if (git_buf_len(buf) == 0) {
...@@ -505,7 +505,8 @@ int git_branch_remote_name(git_buf *buf, git_repository *repo, const char *refna ...@@ -505,7 +505,8 @@ int git_branch_remote_name(git_buf *buf, git_repository *repo, const char *refna
GIT_ASSERT_ARG(repo); GIT_ASSERT_ARG(repo);
GIT_ASSERT_ARG(refname); GIT_ASSERT_ARG(refname);
git_buf_sanitize(buf); if ((error = git_buf_sanitize(buf)) < 0)
return error;
/* Verify that this is a remote branch */ /* Verify that this is a remote branch */
if (!git_reference__is_remote(refname)) { if (!git_reference__is_remote(refname)) {
......
...@@ -140,13 +140,17 @@ void git_buf_free(git_buf *buf) ...@@ -140,13 +140,17 @@ void git_buf_free(git_buf *buf)
} }
#endif #endif
void git_buf_sanitize(git_buf *buf) int git_buf_sanitize(git_buf *buf)
{ {
if (buf->ptr == NULL) { if (buf->ptr == NULL) {
assert(buf->size == 0 && buf->asize == 0); GIT_ASSERT_ARG(buf->size == 0 && buf->asize == 0);
buf->ptr = git_buf__initbuf; buf->ptr = git_buf__initbuf;
} else if (buf->asize > buf->size) } else if (buf->asize > buf->size) {
buf->ptr[buf->size] = '\0'; buf->ptr[buf->size] = '\0';
}
return 0;
} }
void git_buf_clear(git_buf *buf) void git_buf_clear(git_buf *buf)
......
...@@ -69,7 +69,7 @@ extern int git_buf_try_grow( ...@@ -69,7 +69,7 @@ extern int git_buf_try_grow(
* git_buf__initbuf. If a buffer with a non-NULL ptr is passed in, this method * git_buf__initbuf. If a buffer with a non-NULL ptr is passed in, this method
* assures that the buffer is '\0'-terminated. * assures that the buffer is '\0'-terminated.
*/ */
extern void git_buf_sanitize(git_buf *buf); extern int git_buf_sanitize(git_buf *buf);
extern void git_buf_swap(git_buf *buf_a, git_buf *buf_b); extern void git_buf_swap(git_buf *buf_a, git_buf *buf_b);
extern char *git_buf_detach(git_buf *buf); extern char *git_buf_detach(git_buf *buf);
......
...@@ -886,7 +886,8 @@ int git_config_get_string_buf( ...@@ -886,7 +886,8 @@ int git_config_get_string_buf(
int ret; int ret;
const char *str; const char *str;
git_buf_sanitize(out); if ((ret = git_buf_sanitize(out)) < 0)
return ret;
ret = get_entry(&entry, cfg, name, true, GET_ALL_ERRORS); ret = get_entry(&entry, cfg, name, true, GET_ALL_ERRORS);
str = !ret ? (entry->value ? entry->value : "") : NULL; str = !ret ? (entry->value ? entry->value : "") : NULL;
...@@ -1084,19 +1085,31 @@ void git_config_iterator_free(git_config_iterator *iter) ...@@ -1084,19 +1085,31 @@ void git_config_iterator_free(git_config_iterator *iter)
int git_config_find_global(git_buf *path) int git_config_find_global(git_buf *path)
{ {
git_buf_sanitize(path); int error;
if ((error = git_buf_sanitize(path)) < 0)
return error;
return git_sysdir_find_global_file(path, GIT_CONFIG_FILENAME_GLOBAL); return git_sysdir_find_global_file(path, GIT_CONFIG_FILENAME_GLOBAL);
} }
int git_config_find_xdg(git_buf *path) int git_config_find_xdg(git_buf *path)
{ {
git_buf_sanitize(path); int error;
if ((error = git_buf_sanitize(path)) < 0)
return error;
return git_sysdir_find_xdg_file(path, GIT_CONFIG_FILENAME_XDG); return git_sysdir_find_xdg_file(path, GIT_CONFIG_FILENAME_XDG);
} }
int git_config_find_system(git_buf *path) int git_config_find_system(git_buf *path)
{ {
git_buf_sanitize(path); int error;
if ((error = git_buf_sanitize(path)) < 0)
return error;
return git_sysdir_find_system_file(path, GIT_CONFIG_FILENAME_SYSTEM); return git_sysdir_find_system_file(path, GIT_CONFIG_FILENAME_SYSTEM);
} }
...@@ -1104,7 +1117,9 @@ int git_config_find_programdata(git_buf *path) ...@@ -1104,7 +1117,9 @@ int git_config_find_programdata(git_buf *path)
{ {
int ret; int ret;
git_buf_sanitize(path); if ((ret = git_buf_sanitize(path)) < 0)
return ret;
ret = git_sysdir_find_programdata_file(path, ret = git_sysdir_find_programdata_file(path,
GIT_CONFIG_FILENAME_PROGRAMDATA); GIT_CONFIG_FILENAME_PROGRAMDATA);
if (ret != GIT_OK) if (ret != GIT_OK)
...@@ -1360,9 +1375,12 @@ fail_parse: ...@@ -1360,9 +1375,12 @@ fail_parse:
int git_config_parse_path(git_buf *out, const char *value) int git_config_parse_path(git_buf *out, const char *value)
{ {
int error;
assert(out && value); assert(out && value);
git_buf_sanitize(out); if ((error = git_buf_sanitize(out)) < 0)
return error;
if (value[0] == '~') { if (value[0] == '~') {
if (value[1] != '\0' && value[1] != '/') { if (value[1] != '\0' && value[1] != '/') {
......
...@@ -780,7 +780,8 @@ int git_describe_format(git_buf *out, const git_describe_result *result, const g ...@@ -780,7 +780,8 @@ int git_describe_format(git_buf *out, const git_describe_result *result, const g
GIT_ERROR_CHECK_VERSION(given, GIT_DESCRIBE_FORMAT_OPTIONS_VERSION, "git_describe_format_options"); GIT_ERROR_CHECK_VERSION(given, GIT_DESCRIBE_FORMAT_OPTIONS_VERSION, "git_describe_format_options");
normalize_format_options(&opts, given); normalize_format_options(&opts, given);
git_buf_sanitize(out); if ((error = git_buf_sanitize(out)) < 0)
return error;
if (opts.always_use_long_format && opts.abbreviated_size == 0) { if (opts.always_use_long_format && opts.abbreviated_size == 0) {
......
...@@ -764,8 +764,12 @@ int git_diff_print_callback__to_file_handle( ...@@ -764,8 +764,12 @@ int git_diff_print_callback__to_file_handle(
/* print a git_diff to a git_buf */ /* print a git_diff to a git_buf */
int git_diff_to_buf(git_buf *out, git_diff *diff, git_diff_format_t format) int git_diff_to_buf(git_buf *out, git_diff *diff, git_diff_format_t format)
{ {
int error;
assert(out && diff); assert(out && diff);
git_buf_sanitize(out); if ((error = git_buf_sanitize(out)) < 0)
return error;
return git_diff_print(diff, format, git_diff_print_callback__to_buf, out); return git_diff_print(diff, format, git_diff_print_callback__to_buf, out);
} }
...@@ -799,7 +803,12 @@ out: ...@@ -799,7 +803,12 @@ out:
/* print a git_patch to a git_buf */ /* print a git_patch to a git_buf */
int git_patch_to_buf(git_buf *out, git_patch *patch) int git_patch_to_buf(git_buf *out, git_patch *patch)
{ {
int error;
assert(out && patch); assert(out && patch);
git_buf_sanitize(out);
if ((error = git_buf_sanitize(out)) < 0)
return error;
return git_patch_print(patch, git_diff_print_callback__to_buf, out); return git_patch_print(patch, git_diff_print_callback__to_buf, out);
} }
...@@ -725,8 +725,9 @@ int git_filter_list_apply_to_data( ...@@ -725,8 +725,9 @@ int git_filter_list_apply_to_data(
struct buf_stream writer; struct buf_stream writer;
int error; int error;
git_buf_sanitize(tgt); if ((error = git_buf_sanitize(tgt)) < 0 ||
git_buf_sanitize(src); (error = git_buf_sanitize(src)) < 0)
return error;
if (!filters) { if (!filters) {
git_buf_attach_notowned(tgt, src->ptr, src->size); git_buf_attach_notowned(tgt, src->ptr, src->size);
...@@ -832,7 +833,9 @@ static int proxy_stream_close(git_writestream *s) ...@@ -832,7 +833,9 @@ static int proxy_stream_close(git_writestream *s)
if (error == GIT_PASSTHROUGH) { if (error == GIT_PASSTHROUGH) {
writebuf = &proxy_stream->input; writebuf = &proxy_stream->input;
} else if (error == 0) { } else if (error == 0) {
git_buf_sanitize(proxy_stream->output); if ((error = git_buf_sanitize(proxy_stream->output)) < 0)
return error;
writebuf = proxy_stream->output; writebuf = proxy_stream->output;
} else { } else {
/* close stream before erroring out taking care /* close stream before erroring out taking care
...@@ -1004,7 +1007,8 @@ int git_filter_list_stream_data( ...@@ -1004,7 +1007,8 @@ int git_filter_list_stream_data(
git_writestream *stream_start; git_writestream *stream_start;
int error, initialized = 0; int error, initialized = 0;
git_buf_sanitize(data); if ((error = git_buf_sanitize(data)) < 0)
return error;
if ((error = stream_list_init(&stream_start, &filter_streams, filters, target)) < 0) if ((error = stream_list_init(&stream_start, &filter_streams, filters, target)) < 0)
goto out; goto out;
......
...@@ -122,29 +122,28 @@ int git_libgit2_features(void) ...@@ -122,29 +122,28 @@ int git_libgit2_features(void)
; ;
} }
static int config_level_to_sysdir(int config_level) static int config_level_to_sysdir(int *out, int config_level)
{ {
int val = -1;
switch (config_level) { switch (config_level) {
case GIT_CONFIG_LEVEL_SYSTEM: case GIT_CONFIG_LEVEL_SYSTEM:
val = GIT_SYSDIR_SYSTEM; *out = GIT_SYSDIR_SYSTEM;
break; return 0;
case GIT_CONFIG_LEVEL_XDG: case GIT_CONFIG_LEVEL_XDG:
val = GIT_SYSDIR_XDG; *out = GIT_SYSDIR_XDG;
break; return 0;
case GIT_CONFIG_LEVEL_GLOBAL: case GIT_CONFIG_LEVEL_GLOBAL:
val = GIT_SYSDIR_GLOBAL; *out = GIT_SYSDIR_GLOBAL;
break; return 0;
case GIT_CONFIG_LEVEL_PROGRAMDATA: case GIT_CONFIG_LEVEL_PROGRAMDATA:
val = GIT_SYSDIR_PROGRAMDATA; *out = GIT_SYSDIR_PROGRAMDATA;
break; return 0;
default: default:
git_error_set( break;
GIT_ERROR_INVALID, "invalid config path selector %d", config_level);
} }
return val; git_error_set(
GIT_ERROR_INVALID, "invalid config path selector %d", config_level);
return -1;
} }
const char *git_libgit2__user_agent(void) const char *git_libgit2__user_agent(void)
...@@ -190,12 +189,15 @@ int git_libgit2_opts(int key, ...) ...@@ -190,12 +189,15 @@ int git_libgit2_opts(int key, ...)
break; break;
case GIT_OPT_GET_SEARCH_PATH: case GIT_OPT_GET_SEARCH_PATH:
if ((error = config_level_to_sysdir(va_arg(ap, int))) >= 0) { {
int sysdir = va_arg(ap, int);
git_buf *out = va_arg(ap, git_buf *); git_buf *out = va_arg(ap, git_buf *);
const git_buf *tmp; const git_buf *tmp;
int level;
git_buf_sanitize(out); if ((error = config_level_to_sysdir(&level, sysdir)) < 0 ||
if ((error = git_sysdir_get(&tmp, error)) < 0) (error = git_buf_sanitize(out)) < 0 ||
(error = git_sysdir_get(&tmp, level)) < 0)
break; break;
error = git_buf_sets(out, tmp->ptr); error = git_buf_sets(out, tmp->ptr);
...@@ -203,8 +205,12 @@ int git_libgit2_opts(int key, ...) ...@@ -203,8 +205,12 @@ int git_libgit2_opts(int key, ...)
break; break;
case GIT_OPT_SET_SEARCH_PATH: case GIT_OPT_SET_SEARCH_PATH:
if ((error = config_level_to_sysdir(va_arg(ap, int))) >= 0) {
error = git_sysdir_set(error, va_arg(ap, const char *)); int level;
if ((error = config_level_to_sysdir(&level, va_arg(ap, int))) >= 0)
error = git_sysdir_set(level, va_arg(ap, const char *));
}
break; break;
case GIT_OPT_SET_CACHE_OBJECT_LIMIT: case GIT_OPT_SET_CACHE_OBJECT_LIMIT:
...@@ -233,8 +239,8 @@ int git_libgit2_opts(int key, ...) ...@@ -233,8 +239,8 @@ int git_libgit2_opts(int key, ...)
git_buf *out = va_arg(ap, git_buf *); git_buf *out = va_arg(ap, git_buf *);
const git_buf *tmp; const git_buf *tmp;
git_buf_sanitize(out); if ((error = git_buf_sanitize(out)) < 0 ||
if ((error = git_sysdir_get(&tmp, GIT_SYSDIR_TEMPLATE)) < 0) (error = git_sysdir_get(&tmp, GIT_SYSDIR_TEMPLATE)) < 0)
break; break;
error = git_buf_sets(out, tmp->ptr); error = git_buf_sets(out, tmp->ptr);
...@@ -303,7 +309,8 @@ int git_libgit2_opts(int key, ...) ...@@ -303,7 +309,8 @@ int git_libgit2_opts(int key, ...)
case GIT_OPT_GET_USER_AGENT: case GIT_OPT_GET_USER_AGENT:
{ {
git_buf *out = va_arg(ap, git_buf *); git_buf *out = va_arg(ap, git_buf *);
git_buf_sanitize(out); if ((error = git_buf_sanitize(out)) < 0)
break;
error = git_buf_sets(out, git__user_agent); error = git_buf_sets(out, git__user_agent);
} }
break; break;
......
...@@ -28,8 +28,10 @@ int git_message_prettify(git_buf *message_out, const char *message, int strip_co ...@@ -28,8 +28,10 @@ int git_message_prettify(git_buf *message_out, const char *message, int strip_co
int consecutive_empty_lines = 0; int consecutive_empty_lines = 0;
size_t i, line_length, rtrimmed_line_length; size_t i, line_length, rtrimmed_line_length;
char *next_newline; char *next_newline;
int error;
git_buf_sanitize(message_out); if ((error = git_buf_sanitize(message_out)) < 0)
return error;
for (i = 0; i < strlen(message); i += line_length) { for (i = 0; i < strlen(message); i += line_length) {
next_newline = memchr(message + i, '\n', message_len - i); next_newline = memchr(message + i, '\n', message_len - i);
......
...@@ -629,9 +629,8 @@ int git_note_default_ref(git_buf *out, git_repository *repo) ...@@ -629,9 +629,8 @@ int git_note_default_ref(git_buf *out, git_repository *repo)
assert(out && repo); assert(out && repo);
git_buf_sanitize(out); if ((error = git_buf_sanitize(out)) < 0 ||
(error = note_get_default_ref(&default_ref, repo)) < 0)
if ((error = note_get_default_ref(&default_ref, repo)) < 0)
return error; return error;
git_buf_attach(out, default_ref, strlen(default_ref)); git_buf_attach(out, default_ref, strlen(default_ref));
......
...@@ -495,7 +495,9 @@ int git_object_short_id(git_buf *out, const git_object *obj) ...@@ -495,7 +495,9 @@ int git_object_short_id(git_buf *out, const git_object *obj)
assert(out && obj); assert(out && obj);
git_buf_sanitize(out); if ((error = git_buf_sanitize(out)) < 0)
return error;
repo = git_object_owner(obj); repo = git_object_owner(obj);
if ((error = git_repository__configmap_lookup(&len, repo, GIT_CONFIGMAP_ABBREV)) < 0) if ((error = git_repository__configmap_lookup(&len, repo, GIT_CONFIGMAP_ABBREV)) < 0)
......
...@@ -1363,8 +1363,13 @@ int git_packbuilder_foreach(git_packbuilder *pb, int (*cb)(void *buf, size_t siz ...@@ -1363,8 +1363,13 @@ int git_packbuilder_foreach(git_packbuilder *pb, int (*cb)(void *buf, size_t siz
int git_packbuilder_write_buf(git_buf *buf, git_packbuilder *pb) int git_packbuilder_write_buf(git_buf *buf, git_packbuilder *pb)
{ {
int error;
if ((error = git_buf_sanitize(buf)) < 0)
return error;
PREPARE_PACK; PREPARE_PACK;
git_buf_sanitize(buf);
return write_pack(pb, &write_pack_buf, buf); return write_pack(pb, &write_pack_buf, buf);
} }
......
...@@ -245,8 +245,11 @@ static int refspec_transform( ...@@ -245,8 +245,11 @@ static int refspec_transform(
{ {
const char *from_star, *to_star; const char *from_star, *to_star;
size_t replacement_len, star_offset; size_t replacement_len, star_offset;
int error;
if ((error = git_buf_sanitize(out)) < 0)
return error;
git_buf_sanitize(out);
git_buf_clear(out); git_buf_clear(out);
/* /*
...@@ -278,8 +281,12 @@ static int refspec_transform( ...@@ -278,8 +281,12 @@ static int refspec_transform(
int git_refspec_transform(git_buf *out, const git_refspec *spec, const char *name) int git_refspec_transform(git_buf *out, const git_refspec *spec, const char *name)
{ {
int error;
assert(out && spec && name); assert(out && spec && name);
git_buf_sanitize(out);
if ((error = git_buf_sanitize(out)) < 0)
return error;
if (!git_refspec_src_matches(spec, name)) { if (!git_refspec_src_matches(spec, name)) {
git_error_set(GIT_ERROR_INVALID, "ref '%s' doesn't match the source", name); git_error_set(GIT_ERROR_INVALID, "ref '%s' doesn't match the source", name);
...@@ -294,8 +301,12 @@ int git_refspec_transform(git_buf *out, const git_refspec *spec, const char *nam ...@@ -294,8 +301,12 @@ int git_refspec_transform(git_buf *out, const git_refspec *spec, const char *nam
int git_refspec_rtransform(git_buf *out, const git_refspec *spec, const char *name) int git_refspec_rtransform(git_buf *out, const git_refspec *spec, const char *name)
{ {
int error;
assert(out && spec && name); assert(out && spec && name);
git_buf_sanitize(out);
if ((error = git_buf_sanitize(out)) < 0)
return error;
if (!git_refspec_dst_matches(spec, name)) { if (!git_refspec_dst_matches(spec, name)) {
git_error_set(GIT_ERROR_INVALID, "ref '%s' doesn't match the destination", name); git_error_set(GIT_ERROR_INVALID, "ref '%s' doesn't match the destination", name);
......
...@@ -648,14 +648,17 @@ int git_remote_set_pushurl(git_repository *repo, const char *remote, const char* ...@@ -648,14 +648,17 @@ int git_remote_set_pushurl(git_repository *repo, const char *remote, const char*
static int resolve_url(git_buf *resolved_url, const char *url, int direction, const git_remote_callbacks *callbacks) static int resolve_url(git_buf *resolved_url, const char *url, int direction, const git_remote_callbacks *callbacks)
{ {
int status; int status, error;
if (callbacks && callbacks->resolve_url) { if (callbacks && callbacks->resolve_url) {
git_buf_clear(resolved_url); git_buf_clear(resolved_url);
status = callbacks->resolve_url(resolved_url, url, direction, callbacks->payload); status = callbacks->resolve_url(resolved_url, url, direction, callbacks->payload);
if (status != GIT_PASSTHROUGH) { if (status != GIT_PASSTHROUGH) {
git_error_set_after_callback_function(status, "git_resolve_url_cb"); git_error_set_after_callback_function(status, "git_resolve_url_cb");
git_buf_sanitize(resolved_url);
if ((error = git_buf_sanitize(resolved_url)) < 0)
return error;
return status; return status;
} }
} }
...@@ -2403,7 +2406,8 @@ int git_remote_default_branch(git_buf *out, git_remote *remote) ...@@ -2403,7 +2406,8 @@ int git_remote_default_branch(git_buf *out, git_remote *remote)
goto done; goto done;
} }
git_buf_sanitize(out); if ((error = git_buf_sanitize(out)) < 0)
return error;
/* the first one must be HEAD so if that has the symref info, we're done */ /* the first one must be HEAD so if that has the symref info, we're done */
if (heads[0]->symref_target) { if (heads[0]->symref_target) {
......
...@@ -945,10 +945,12 @@ int git_repository_discover( ...@@ -945,10 +945,12 @@ int git_repository_discover(
const char *ceiling_dirs) const char *ceiling_dirs)
{ {
uint32_t flags = across_fs ? GIT_REPOSITORY_OPEN_CROSS_FS : 0; uint32_t flags = across_fs ? GIT_REPOSITORY_OPEN_CROSS_FS : 0;
int error;
assert(start_path); assert(start_path);
git_buf_sanitize(out); if ((error = git_buf_sanitize(out)) < 0)
return error;
return find_repo(out, NULL, NULL, NULL, start_path, flags, ceiling_dirs); return find_repo(out, NULL, NULL, NULL, start_path, flags, ceiling_dirs);
} }
...@@ -2609,7 +2611,8 @@ int git_repository_message(git_buf *out, git_repository *repo) ...@@ -2609,7 +2611,8 @@ int git_repository_message(git_buf *out, git_repository *repo)
struct stat st; struct stat st;
int error; int error;
git_buf_sanitize(out); if ((error = git_buf_sanitize(out)) < 0)
return error;
if (git_buf_joinpath(&path, repo->gitdir, GIT_MERGE_MSG_FILE) < 0) if (git_buf_joinpath(&path, repo->gitdir, GIT_MERGE_MSG_FILE) < 0)
return -1; return -1;
......
...@@ -998,7 +998,8 @@ int git_submodule_resolve_url(git_buf *out, git_repository *repo, const char *ur ...@@ -998,7 +998,8 @@ int git_submodule_resolve_url(git_buf *out, git_repository *repo, const char *ur
assert(out && repo && url); assert(out && repo && url);
git_buf_sanitize(out); if ((error = git_buf_sanitize(out)) < 0)
return error;
/* We do this in all platforms in case someone on Windows created the .gitmodules */ /* We do this in all platforms in case someone on Windows created the .gitmodules */
if (strchr(url, '\\')) { if (strchr(url, '\\')) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment