diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2014-02-21 15:43:31 +0200 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2014-02-21 15:47:22 +0200 |
commit | 0c5783ff301ae3e470000c918bfc2395129de4c5 (patch) | |
tree | 2e15c47ea6712798ecf519785d58dd3fae8f5326 /src/backend/utils/adt/array_selfuncs.c | |
parent | 8c059dffd83384fa0c2fe6050429d601355bc3af (diff) | |
download | postgresql-0c5783ff301ae3e470000c918bfc2395129de4c5.tar.gz postgresql-0c5783ff301ae3e470000c918bfc2395129de4c5.zip |
Avoid integer overflow in hstore_to_json().
The length of the output buffer was calculated based on the size of the
argument hstore. On a sizeof(int) == 4 platform and a huge argument, it
could overflow, causing a too small buffer to be allocated.
Refactor the function to use a StringInfo instead of pre-allocating the
buffer. Makes it shorter and more readable, too.
Diffstat (limited to 'src/backend/utils/adt/array_selfuncs.c')
0 files changed, 0 insertions, 0 deletions