} while (0)
#define DOWNLOAD_FILENAME_MAX 256
+#define DOWNLOAD_HTTP_HEADER_FIELDS_MAX 200
#ifndef SIZE_MAX
#define SIZE_MAX ((size_t) -1)
if (dp_ipc_read(sock, &array_size, extra_size, __FUNCTION__) < 0) {
errorcode = DP_ERROR_IO_ERROR;
} else {
- if (array_size <= 0 && array_size >= SIZE_MAX) {
+ if (array_size <= 0) {
errorcode = DP_ERROR_NO_DATA;
*length = 0;
} else {
int i = 0;
char **recv_strings = NULL;
+
+ if (array_size > DOWNLOAD_HTTP_HEADER_FIELDS_MAX)
+ array_size = DOWNLOAD_HTTP_HEADER_FIELDS_MAX;
+
recv_strings = (char **)calloc(array_size, sizeof(char *));
if (recv_strings == NULL) {
TRACE_ERROR("check memory size:%d", array_size);