diff options
author | Dan Nicholson <dbn@endlessos.org> | 2021-12-21 16:03:45 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-21 16:03:45 -0700 |
commit | b1ddc6c2488097ea28aca5a43a769b638bb05131 (patch) | |
tree | 6f671a7849560f578420fe60b99246a804873b7e | |
parent | 998863e74d18ced5b2faecd1e817b8d2d24ecb5c (diff) | |
parent | d2f5a0476f37973d2027029662f41413d2d8e243 (diff) | |
download | ostree-b1ddc6c2488097ea28aca5a43a769b638bb05131.tar.gz |
Merge pull request #2502 from cgwalters/analyzer
two minor clang-analyzer fixes
-rw-r--r-- | src/libostree/ostree-soup-uri.c | 45 | ||||
-rw-r--r-- | tests/test-commit-sign-sh-ext.c | 8 |
2 files changed, 4 insertions, 49 deletions
diff --git a/src/libostree/ostree-soup-uri.c b/src/libostree/ostree-soup-uri.c index ba14e5c6..bfc5dd1a 100644 --- a/src/libostree/ostree-soup-uri.c +++ b/src/libostree/ostree-soup-uri.c @@ -16,8 +16,6 @@ char *soup_uri_decoded_copy (const char *str, int length, int *decoded_length); char *soup_uri_to_string_internal (SoupURI *uri, gboolean just_path_and_query, gboolean force_port); -gboolean soup_uri_is_http (SoupURI *uri, char **aliases); -gboolean soup_uri_is_https (SoupURI *uri, char **aliases); /* OSTREECHANGE: import soup-misc's char helpers */ #define SOUP_CHAR_URI_PERCENT_ENCODED 0x01 @@ -1436,48 +1434,5 @@ soup_uri_host_equal (gconstpointer v1, gconstpointer v2) return g_ascii_strcasecmp (one->host, two->host) == 0; } -gboolean -soup_uri_is_http (SoupURI *uri, char **aliases) -{ - int i; - - if (uri->scheme == SOUP_URI_SCHEME_HTTP) - return TRUE; - else if (uri->scheme == SOUP_URI_SCHEME_HTTPS) - return FALSE; - else if (!aliases) - return FALSE; - - for (i = 0; aliases[i]; i++) { - if (uri->scheme == aliases[i]) - return TRUE; - } - - if (!aliases[1] && !strcmp (aliases[0], "*")) - return TRUE; - else - return FALSE; -} - -gboolean -soup_uri_is_https (SoupURI *uri, char **aliases) -{ - int i; - - if (uri->scheme == SOUP_URI_SCHEME_HTTPS) - return TRUE; - else if (uri->scheme == SOUP_URI_SCHEME_HTTP) - return FALSE; - else if (!aliases) - return FALSE; - - for (i = 0; aliases[i]; i++) { - if (uri->scheme == aliases[i]) - return TRUE; - } - - return FALSE; -} - /* OSTREECHANGE: drop boxed type definition */ /* G_DEFINE_BOXED_TYPE (SoupURI, soup_uri, soup_uri_copy, soup_uri_free) */ diff --git a/tests/test-commit-sign-sh-ext.c b/tests/test-commit-sign-sh-ext.c index dee22573..6dc287d9 100644 --- a/tests/test-commit-sign-sh-ext.c +++ b/tests/test-commit-sign-sh-ext.c @@ -80,26 +80,26 @@ run (GError **error) if (ostree_repo_signature_verify_commit_data (repo, "origin", commit_bytes, detached_meta_bytes, OSTREE_REPO_VERIFY_FLAGS_NO_GPG | OSTREE_REPO_VERIFY_FLAGS_NO_SIGNAPI, &verify_report, error)) - g_error ("Should not have validated"); + return glnx_throw (error, "Should not have validated"); assert_error_contains (error, "No commit verification types enabled"); // No signatures g_autoptr(GBytes) empty = g_bytes_new_static ("", 0); if (ostree_repo_signature_verify_commit_data (repo, "origin", commit_bytes, empty, 0, &verify_report, error)) - g_error ("Should not have validated"); + return glnx_throw (error, "Should not have validated"); assert_error_contains (error, "no signatures found"); // No such remote if (ostree_repo_signature_verify_commit_data (repo, "nosuchremote", commit_bytes, detached_meta_bytes, 0, &verify_report, error)) - g_error ("Should not have validated"); + return glnx_throw (error, "Should not have validated"); assert_error_contains (error, "Remote \"nosuchremote\" not found"); // Corrupted commit g_autoptr(GBytes) corrupted_commit = corrupt (commit_bytes); if (ostree_repo_signature_verify_commit_data (repo, "origin", corrupted_commit, detached_meta_bytes, 0, &verify_report, error)) - g_error ("Should not have validated"); + return glnx_throw (error, "Should not have validated"); assert_error_contains (error, "BAD signature"); return TRUE; |