mirror of
https://github.com/emqx/neuron.git
synced 2026-10-18 13:41:22 +08:00
fix: check array size
This commit is contained in:
@@ -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];
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user