Timeout error found in cJSON_Compare
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Bắt đầu bằng cách biên dịch và chạy POC đã được tối giản với cJSON_Parse, cJSON_Duplicate và cJSON_Compare, sau đó truy vết nơi phép so sánh ngừng tiến triển trong đối tượng lồng nhau. Issue không nêu tệp mã nguồn hay kiểm thử hồi quy nào; được xem là hoàn tất khi POC hoàn thành mà không bị hết thời gian chờ, đồng thời vẫn giữ đúng hành vi so sánh.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Dear developers,
I found a timeout error in the cJSON_Compare API when fuzzing the cJSON library.
The following is the minimized POC code:
#include <fuzzer/FuzzedDataProvider.h>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <string>
#include <vector>
#include "cjson/cJSON.h"
int main() {
bool case_sensitive_operations = true;
bool recurse_duplicate = true;
uint8_t operation_selector = 5;
// Consume variable-size data for JSON strings and object keys
std::string initial_json = "{\t\"%q\":{\t\"ky\"\001:{\"e\"\t:{\"ey\"\001:{\"\377\377\":{\"e\":{\"\037\"\001:{\"e\":{\"k\"\001:{\"e\"\t:{\t\"\"\001:{\"\377\377\"\001:{\"y\"\001:{\"seye\"\t:{\t\"ke\"\001:{\"\377k\"\001:{\"ke8\"\001:{\t\"%v\"\t:{\t\"key\"\001:{\"\377\377\377\037\"\001:{\"e\"\t:{\t\"k\"\001:{\"e\"\t:{\t\"k\"\001:{\"\377\377\377\"\001:{\"y\"\t:{\t\"ey\"\001:{\"\377\377\377\037\"\001:{\"e\"\t:{\"k\"\001:{\"e\"\t:{\t\"k\":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}{\".t\000\000\000\377\377\377}";
// Create initial JSON object using cJSON_Parse
cJSON* root = nullptr;
if (!initial_json.empty()) {
root = cJSON_Parse(initial_json.c_str());
}
// Create a duplicate of the object using cJSON_Duplicate
cJSON* duplicated_object = cJSON_Duplicate(root, recurse_duplicate ? 1 : 0);
// Compare the original and duplicate objects using cJSON_Compare
if (duplicated_object != nullptr) {
cJSON_bool comparison_result = cJSON_Compare(root, duplicated_object, case_sensitive_operations ? 1 : 0);
(void)comparison_result; // Suppress unused variable warning
}
cleanup:
// Clean up all allocated memory
if (root != nullptr) {
cJSON_Delete(root);
}
if (duplicated_object != nullptr) {
cJSON_Delete(duplicated_object);
}
return 0;
}
- Ngôn ngữ chính
- C
- Star
- 13k
- Fork
- 3.5k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của DaveGamble/cJSON
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
DaveGamble/cJSON#1094 · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
DaveGamble/cJSON#1093 ·
-
Use-after-free in cJSONUtils_ApplyPatches when a patch removes the patch arrayCó thể đã có người làm @iliasabk đã nhận 25 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
DaveGamble/cJSON#1082 ·
-
Use-after-free in cJSON_ReplaceItemInObject when the key is the item's own nameCó thể đã có người làm @iliasabk đã nhận 26 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
DaveGamble/cJSON#1081 ·
-
buffer_skip_whitespace accepts every byte below 0x21 as whitespaceCó thể đã có người làm @AetherAI3 đã nhận 37 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
DaveGamble/cJSON#1074 ·
Tất cả issue của DaveGamble/cJSON
Issue tương tự
-
UB: (int) cast of a user double outside int range in dispatch / vm_index_is_int / flat_index_atĐang mởarea:runtime-vm
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
InauguralSystems/EigenScript#1748 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chore: update release scheduleĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
foomatic-rip: dstrtrim_right() underflows mid-loop on an all-whitespace stringCó thể đã có người làm @ManasBagul23 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
OpenPrinting/cups-filters#759 ·
Maintainer thường phản hồi trong vòng 11 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
EchoTools/nevr-runtime#547 ·
Maintainer thường phản hồi trong vòng 1 ngày