From: Todd C. Miller Date: Sun, 20 May 2018 13:42:54 +0000 (-0600) Subject: Fix pointer sign warnings. X-Git-Tag: SUDO_1_8_24^2~63 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a04cb53e37cac5b91e877ab797175d14698e1220;p=sudo Fix pointer sign warnings. --- diff --git a/plugins/sudoers/cvtsudoers_ldif.c b/plugins/sudoers/cvtsudoers_ldif.c index fee0a4572..ce8301a69 100644 --- a/plugins/sudoers/cvtsudoers_ldif.c +++ b/plugins/sudoers/cvtsudoers_ldif.c @@ -93,6 +93,7 @@ safe_string(const char *str) static bool print_attribute_ldif(FILE *fp, const char *name, const char *value) { + const unsigned char *uvalue = (unsigned char *)value; char *encoded = NULL; size_t esize; debug_decl(print_attribute_ldif, SUDOERS_DEBUG_UTIL) @@ -102,7 +103,7 @@ print_attribute_ldif(FILE *fp, const char *name, const char *value) esize = ((vlen + 2) / 3 * 4) + 1; if ((encoded = malloc(esize)) == NULL) debug_return_bool(false); - if (base64_encode(value, vlen, encoded, esize) == (size_t)-1) { + if (base64_encode(uvalue, vlen, encoded, esize) == (size_t)-1) { free(encoded); debug_return_bool(false); } @@ -743,7 +744,7 @@ ldif_parse_attribute(char *str) attr = str; if (encoded) { /* decode base64 inline and NUL-terminate */ - len = base64_decode(str, attr, strlen(str)); + len = base64_decode(str, (unsigned char *)attr, strlen(str)); attr[len] = '\0'; } diff --git a/plugins/sudoers/regress/parser/check_base64.c b/plugins/sudoers/regress/parser/check_base64.c index 04637ee41..0e82b43f2 100644 --- a/plugins/sudoers/regress/parser/check_base64.c +++ b/plugins/sudoers/regress/parser/check_base64.c @@ -101,7 +101,8 @@ main(int argc, char *argv[]) } /* Test encode. */ - len = base64_encode(test_strings[i].ascii, strlen(test_strings[i].ascii), buf, sizeof(buf)); + len = base64_encode((unsigned char *)test_strings[i].ascii, + strlen(test_strings[i].ascii), (char *)buf, sizeof(buf)); if (len == (size_t)-1) { fprintf(stderr, "check_base64: failed to encode %s\n", test_strings[i].ascii);