fix: check array size

This commit is contained in:
fengzero
2025-02-25 07:22:39 +00:00
parent f34d3e9d5c
commit e8dba7a4ac
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -156,6 +156,7 @@ typedef struct {
} neu_value_ptr_t;
#define NEU_VALUE_SIZE 512
#define NEU_ARRAY_SIZE 128
typedef struct {
uint8_t bytes[NEU_VALUE_SIZE];
+1 -1
View File
@@ -284,7 +284,7 @@ void handle_write(nng_aio *aio)
}
if (req->t == NEU_JSON_ARRAY_INT64 &&
req->value.val_array_int64.length > NEU_VALUE_SIZE) {
req->value.val_array_int64.length > NEU_ARRAY_SIZE) {
NEU_JSON_RESPONSE_ERROR(NEU_ERR_STRING_TOO_LONG, {
neu_http_response(aio, NEU_ERR_STRING_TOO_LONG,
result_error);