summaryrefslogtreecommitdiffstats
path: root/src/modules/raop
diff options
context:
space:
mode:
authorColin Guthrie <pulse@colin.guthr.ie>2009-01-13 23:34:09 +0000
committerColin Guthrie <pulse@colin.guthr.ie>2009-01-13 23:39:17 +0000
commitdf564040b5f0e530730b11d0ad04abae12edb06f (patch)
treeb6709bf1c5a84253e4b1b578a072fe47716586a8 /src/modules/raop
parentf3101133d7c1dec9f4e79c9f3508c692c6b6b682 (diff)
Fix a potentially non-returning function in base64 code.
Diffstat (limited to 'src/modules/raop')
-rw-r--r--src/modules/raop/base64.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/modules/raop/base64.c b/src/modules/raop/base64.c
index 8918def8..059c7028 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;