remote: Minor argument parsing cleanup

Only access relevant portion of argv after we've verified argc.

https://bugzilla.gnome.org/show_bug.cgi?id=731984
This commit is contained in:
Colin Walters committed 2014-06-21 15:57:43 -04:00
1 parent 1962623bbc
commit 6eac108560
1 file changed
+3 -1
+3 -1
View File
@@ -98,7 +98,7 @@ ostree_builtin_remote (int argc, char **argv, OstreeRepo *repo, GCancellable *ca
if (!strcmp (op, "add"))
{
const char *url = argv[3];
const char *url;
char **iter;
gs_free char *target_name = NULL;
gs_unref_object GFile *target_conf = NULL;
@@ -110,6 +110,8 @@ ostree_builtin_remote (int argc, char **argv, OstreeRepo *repo, GCancellable *ca
goto out;
}
url = argv[3];
optbuilder = g_variant_builder_new (G_VARIANT_TYPE ("a{sv}"));
if (argc > 4)