mjson icon indicating copy to clipboard operation
mjson copied to clipboard

C/C++ JSON parser, emitter, JSON-RPC engine for embedded systems

Results 25 mjson issues
Sort by recently updated
recently updated
newest added

I run the unit_test.c in arm clang. test_printf fail because "%M" point to jsonrpc_print_methods.

Clang creates a warning about unused variables which was discovered by HAPoxy community https://github.com/haproxy/haproxy/issues/1868 One suggestion is to create a pragma for clang https://github.com/haproxy/haproxy/issues/1868#issuecomment-1250049715 Another option is to add a...

``` const char* j3 = "{\"a\":[],\"ab\":[{\"c1\":1,\"c2\":2},{\"c1\":3,\"c2\":4}]}"; ASSERT(mjson_find(j3, strlen(j3), "$.a[0]", &p, &n) == MJSON_TOK_INVALID); // this line FAIL! ``` ``` printf("mjson got: %d\n", mjson_find(j3, strlen(j3), "$.a[0]", &p, &n)); printf("got: %.*s\n", n,...

When passing a zero length output buffer, mjson_print_fixed_buf (specifically, this line https://github.com/cesanta/mjson/blob/master/src/mjson.c#L479) writes out of bounds `fb->len` is `-1`. I would expect to not write anything, but writing before the...

This adds fuzzing by way of [ClusterFuzzLite](https://google.github.io/clusterfuzzlite/), which is a GitHub action that will perform a short amount of fuzzing for new PRs. The goal is to use fuzzing to...

because sizeof(bool) is not the same as sizeof(int), If someone put a bool var as the last param into funciton `int mjson_get_bool(const char *s, int len, const char *path, int...

We have to include `alloca.h` if we want to use the `alloca()` function. ```C build/pkg/mjson/src/mjson.c: In function ‘mjson_merge’: build/pkg/mjson/src/mjson.c:823:27: error: implicit declaration of function ‘alloca’ [-Werror=implicit-function-declaration] char *path = (char...

# Summary This pull request introduces a CodeQL workflow to enhance the security analysis of this repository. # What is CodeQL CodeQL is a static analysis tool that helps identify...

`mjson_get_XXX(...)` return 0 or -1 for "not found", I suggest all use -1. or better, return true on "found" and false on "not found", so these parser function can be...

According to the [JSON-RPC 2.0 specification](https://www.jsonrpc.org/specification#response_object), a response object must contain a member specifying the protocol version as follows: "jsonrpc":"2.0" Currently that member is missing from any response. However, I...