Giter Site home page Giter Site logo

json-build's Introduction

json-build's People

Contributors

lcsmuller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

json-build's Issues

Compilation error with GCC 10.2.1 (embedded)

GCC version 10.2.1
The _jsonb_escape function returns a log, but this is assigned to a jsonbcode eum value in the calling routines.
It isn't always possible to add a compilation flag to allow this, as the compiler error suggests:


json-build/json-build.h:406:28: error: invalid conversion from 'long int' to 'jsonbcode' [-fpermissive]

  406 |         ret = _jsonb_escape(&pos, buf + b->pos, bufsize - b->pos, key, len);
      |               ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                            |
      |                            long int

possible memory leak when calling _jsonb_escape

Hi!

We are using your amazing library and found a potential mem leak. I'm not sure the patch we prepared to solve it is good though:

pantacor#2

Seems like _jsonb_escape was using the complete bufsize but buf was passed as buf + b->pos. So could _jsonb_escape be writing beyond the limits of buf?

To give some context, we are allocating an initial buffer that we resize if any of the build functions return JSONB_ERROR_NOMEM.

question about jsonb_init()

Hello,

I could not find a better way to ask a question about some implementation details in jsonb_init(), from jason-build.
What is the purpose of the following code:
void
jsonb_init(jsonb *b)
{
static jsonb empty_builder;
*b = empty_builder;
....

Thanks in advance.
Volodimir

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.