Skip to content

Commit 463c21e

Browse files
committed
Apply code review feedback
1 parent 416aafd commit 463c21e

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

fuzzers/config_file_fuzzer.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,17 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
4343
git_config_backend *backend = NULL;
4444
int err = 0;
4545

46-
err = git_config_new(&cfg);
47-
if (err != 0) {
46+
if ((err = git_config_new(&cfg)) != 0) {
4847
goto out;
4948
}
5049

51-
err = git_config_backend_from_string(&backend, (const char*)data, size);
52-
if (err != 0) {
50+
if ((err = git_config_backend_from_string(&backend, (const char*)data, size)) != 0) {
5351
goto out;
5452
}
55-
err = git_config_add_backend(cfg, backend, 0, NULL, 0);
56-
if (err != 0) {
53+
if ((err = git_config_add_backend(cfg, backend, 0, NULL, 0)) != 0) {
5754
goto out;
5855
}
59-
// Now owned by the config
56+
/* Now owned by the config */
6057
backend = NULL;
6158

6259
git_config_foreach(cfg, foreach_cb, NULL);

src/config_mem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ int git_config_backend_from_string(git_config_backend **out, const char *cfg, si
198198
return -1;
199199
}
200200

201-
if (git_buf_put(&backend->cfg, cfg, len) < 0) {
201+
if (git_buf_set(&backend->cfg, cfg, len) < 0) {
202202
git_config_entries_free(backend->entries);
203203
git__free(backend);
204204
return -1;

0 commit comments

Comments
 (0)