From: Colin Guthrie Date: Tue, 13 Jan 2009 23:34:09 +0000 (+0000) Subject: Fix a potentially non-returning function in base64 code. X-Git-Tag: 1.0_branch~2418 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=df564040b5f0e530730b11d0ad04abae12edb06f;p=profile%2Fivi%2Fpulseaudio.git Fix a potentially non-returning function in base64 code. --- diff --git a/src/modules/raop/base64.c b/src/modules/raop/base64.c index 8918def..059c702 100644 --- a/src/modules/raop/base64.c +++ b/src/modules/raop/base64.c @@ -45,6 +45,7 @@ static int pos(char c) if (c >= '0' && c <= '9') return c - '0' + 52; if (c == '+') return 62; if (c == '/') return 63; + return -1; } int pa_base64_encode(const void *data, int size, char **str) @@ -97,8 +98,12 @@ static unsigned int token_decode(const char *token) marker++; else if (marker > 0) return DECODE_ERROR; - else - val += pos(token[i]); + else { + int lpos = pos(token[i]); + if (lpos < 0) + return DECODE_ERROR; + val += lpos; + } } if (marker > 2) return DECODE_ERROR;