mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-29 06:20:56 +00:00
git_libgit2_opts: validate key
This commit is contained in:
parent
5bc93eaea0
commit
7bab2e8fbf
@ -181,6 +181,9 @@ int git_libgit2_opts(int key, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
giterr_set(GITERR_INVALID, "invalid option key");
|
||||||
|
error = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
@ -17,3 +17,9 @@ void test_core_opts__readwrite(void)
|
|||||||
|
|
||||||
cl_assert(new_val == old_val);
|
cl_assert(new_val == old_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void test_core_opts__invalid_option(void)
|
||||||
|
{
|
||||||
|
cl_git_fail(git_libgit2_opts(-1, "foobar"));
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user