#define MAX_REQUEST_ARGUMENT_SIZE 1048576 /* 1MB */
#define MAX_ROW_COUNT 1024
#define MAX_COLUMN_SIZE 512
+#define MAX_COLUMN_COUNT 32767 /* Base on sqlite3 maximum column count */
#define MAX_VALUE_COUNT 1024
/**
#define QUERY_MAXLEN 4096
#define ROW_ID_SIZE 32
#define RESULT_PATH_MAX 512
-#define MAX_COLUMN_COUNT 32767 /* Base on sqlite3 maximum column count */
#define RESULT_PAGE_NUMBER "RESULT_PAGE_NUMBER"
#define MAX_COUNT_PER_PAGE "MAX_COUNT_PER_PAGE"
goto out;
}
- cursor->resultset_col_count = column_count;
- LOGI("column_count : %d", column_count);
/* no data check. */
if (column_count == DATACONTROL_RESULT_NO_DATA) {
LOGE("No result");
return DATACONTROL_ERROR_NONE;
}
+ if (column_count < 0 || column_name_len > MAX_COLUMN_COUNT) {
+ retval = DATACONTROL_ERROR_IO_ERROR;
+ LOGE("Invalid column_count %d", column_count);
+ goto out;
+ }
+
+ cursor->resultset_col_count = column_count;
+ LOGI("column_count : %d", column_count);
+
if (write(result_fd, &column_count, sizeof(int)) == -1) {
LOGE("Writing a column_count to a file descriptor is failed. errno = %d", errno);
retval = DATACONTROL_ERROR_IO_ERROR;