krb5: Fix coverity warnings

This commit is contained in:
Nicolas Williams
2022-01-19 23:38:27 -06:00
parent 9203c4a3f4
commit 1eda4920c8
16 changed files with 90 additions and 83 deletions

View File

@@ -452,7 +452,7 @@ dcc_resolve_2(krb5_context context,
/* Strip off extra slashes on the end */
for (len = strlen(dc->dir);
len && ISPATHSEP(dc->dir[len - 1]);
len -= len ? 1 : 0)
len--)
dc->dir[len - 1] = '\0';
/* If we got here then `dc->dir' and `dc->sub' must both be set */
@@ -676,7 +676,7 @@ dcc_get_cache_first(krb5_context context, krb5_cc_cursor *cursor)
/* Strip off extra slashes on the end */
for (len = strlen(iter->dc->dir);
len && ISPATHSEP(iter->dc->dir[len - 1]);
len -= len ? 1 : 0) {
len--) {
iter->dc->dir[len - 1] = '\0';
}