]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
Fix out of bounds error on parse of b64 with invalid characters.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 2 Mar 2015 14:31:57 +0000 (15:31 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 2 Mar 2015 14:31:57 +0000 (15:31 +0100)
compat/b64_pton.c

index abe32819e92d1c125e200d4eabf96ff9a23718bd..18d8c8e976c29e7b6a601747c4c2c4163cd48c00 100644 (file)
@@ -118,15 +118,16 @@ static const char Pad64 = '=';
  */
 
 int
-ldns_b64_pton(char const *src, uint8_t *target, size_t targsize)
+ldns_b64_pton(char const *origsrc, uint8_t *target, size_t targsize)
 {
+       unsigned char const* src = (unsigned char*)origsrc;
        int tarindex, state, ch;
        char *pos;
 
        state = 0;
        tarindex = 0;
 
-       if (strlen(src) == 0) {
+       if (strlen(origsrc) == 0) {
                return 0;
        }