• Tom Lane's avatar
    Fix broken allocation logic in recently-rewritten jsonb_util.c. · 3d8c2b49
    Tom Lane authored
    reserveFromBuffer() failed to consider the possibility that it needs to
    more-than-double the current buffer size.  Beyond that, it seems likely
    that we'd someday need to worry about integer overflow of the buffer
    length variable.  Rather than reinvent the logic that's already been
    debugged in stringinfo.c, let's go back to using that logic.  We can
    still have the same targeted API, but we'll rely on stringinfo.c to
    manage reallocation.
    
    Per report from Alexander Korotkov.
    3d8c2b49
jsonb_util.c 42.5 KB