From: W.C.A. Wijngaards Date: Mon, 2 Mar 2015 14:31:57 +0000 (+0100) Subject: Fix out of bounds error on parse of b64 with invalid characters. X-Git-Tag: release-1.7.0-rc1~102 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87c77a7350977dcb8c04dceedf7e78171f4d4589;p=thirdparty%2Fldns.git Fix out of bounds error on parse of b64 with invalid characters. --- diff --git a/compat/b64_pton.c b/compat/b64_pton.c index abe32819..18d8c8e9 100644 --- a/compat/b64_pton.c +++ b/compat/b64_pton.c @@ -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; }