diff options
author | Yang Tse <yangsita@gmail.com> | 2010-02-14 13:14:17 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2010-02-14 13:14:17 +0000 |
commit | 68d83a8142e52643cc98d692dce54a49d9e2c386 (patch) | |
tree | 6f43b3dfcb3d2c9aa665fea513159d926339ea01 /tests/server/getpart.h | |
parent | b4ff6d3007be58423a1e6b8b8aa2e038dd1b04c0 (diff) | |
download | curl-68d83a8142e52643cc98d692dce54a49d9e2c386.tar.gz |
Overhauled test suite getpart() function. Fixing potential out of bounds
stack and memory overwrites triggered with huge test case definitions.
Diffstat (limited to 'tests/server/getpart.h')
-rw-r--r-- | tests/server/getpart.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/tests/server/getpart.h b/tests/server/getpart.h index a13badb9f..276d41de7 100644 --- a/tests/server/getpart.h +++ b/tests/server/getpart.h @@ -1,3 +1,5 @@ +#ifndef HEADER_SERVER_GETPART_H +#define HEADER_SERVER_GETPART_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | @@ -5,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2010, 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 @@ -20,8 +22,13 @@ * * $Id$ ***************************************************************************/ -const char * -spitout(FILE *stream, - const char *main, - const char *sub, - size_t *size); + +#define GPE_NO_BUFFER_SPACE -2 +#define GPE_OUT_OF_MEMORY -1 +#define GPE_OK 0 +#define GPE_END_OF_FILE 1 + +int getpart(char **outbuf, size_t *outlen, + const char *main, const char *sub, FILE *stream); + +#endif /* HEADER_SERVER_GETPART_H */ |