aboutsummaryrefslogtreecommitdiff
path: root/tests/server
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2011-08-24 08:07:36 +0200
committerYang Tse <yangsita@gmail.com>2011-08-24 08:10:30 +0200
commitfd00b382b2d33ef90c6f5c840a32b66c8ceb1662 (patch)
treee95c73f96e5b4e67059326823e68ce78fc6f300b /tests/server
parentcce6508242ab73cca896788ad9f968b89e5f9f3a (diff)
base64: fix Curl_base64_encode and Curl_base64_decode interfaces
Previous interfaces for these libcurl internal functions did not allow to tell apart a legitimate zero size result from an error condition. These functions now return a CURLcode indicating function success or otherwise specific error. Output size is returned using a pointer argument. All usage of these two functions, and others closely related, has been adapted to the new interfaces. Relative error and OOM handling adapted or added where missing. Unit test 1302 also adapted.
Diffstat (limited to 'tests/server')
-rw-r--r--tests/server/getpart.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/server/getpart.c b/tests/server/getpart.c
index 743cb21b9..2351e1cc3 100644
--- a/tests/server/getpart.c
+++ b/tests/server/getpart.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -166,7 +166,9 @@ static int appenddata(char **dst_buf, /* dest buffer */
if(src_b64) {
/* base64 decode the given buffer */
- src_len = Curl_base64_decode(src_buf, &buf64.as_uchar);
+ int error = (int) Curl_base64_decode(src_buf, &buf64.as_uchar, &src_len);
+ if(error)
+ return GPE_OUT_OF_MEMORY;
src_buf = buf64.as_char;
if(!src_len || !src_buf) {
/*