aboutsummaryrefslogtreecommitdiff
path: root/strbuf.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Bugfix: Lua cjson integer overflow issues (CVE-2022-24834) (#94)2.1.0.13lijunlong2023-07-201-27/+19
| | | | | | | * Fix integer overflows due to using wrong integer size. * Add assertions / panic when overflow still happens. Co-authored-by: Oran Agra <oran@redislabs.com> Co-authored-by: Yossi Gottlieb <yossigo@gmail.com>
* feature: Add option to skip invalid value types. lijunlong2023-02-221-0/+6
| | | Co-authored-by: Jesper Lundgren <jesperlundgren@exosite.com>
* feature: supports MS C compiler older than VC2012.spacewander2017-01-311-0/+5
| | | | Signed-off-by: Yichun Zhang (agentzh) <agentzh@gmail.com>
* Update copyright date range to include 2012Mark Pulford2012-03-041-1/+1
|
* Add fpconv to work around comma decimal pointsMark Pulford2011-12-301-1/+13
| | | | | | | | Create a separate buffer and translate comma <> dot before calling strtod(), and after calling sprintf() as required. - Add "update_locale" Lua API call and init locale on module load. - Move sprintf format string to fpconv
* Add support for runtime number precision configMark Pulford2011-05-291-2/+2
| | | | | | Add cjson.encode_number_precision(). Reducing the number precision from 14 to 3 can increase performance up to 50% with number heavy conversions.
* Remove trailing whitespace1.0.1Mark Pulford2011-05-101-3/+3
|
* Add runtime option for persistent encode bufferMark Pulford2011-05-101-0/+5
|
* Preallocate temporary decode string bufferMark Pulford2011-05-031-0/+6
| | | | | The preallocated buffer removes the need for buffer length checks while processing strings and results in a 10 - 15% speedup.
* Add strbuf_reset() to reset string lengthMark Pulford2011-05-031-0/+6
| | | | | Add strbuf_reset() to reset string length and hide the string implementation.
* Add strbuf_append_number()Mark Pulford2011-05-031-1/+9
| | | | | | | | The separate strbuf_append_number() function avoids a potential double call to the slow vsnprintf() function required by strbuf_append_fmt(). Also inline strbuf_append_mem() since it is very simple and will be used often.
* Add MIT license and update lua_cjson.c caveatsMark Pulford2011-05-011-0/+24
|
* Grow decode stack, prealloc strings during encodeMark Pulford2011-04-251-2/+12
| | | | | | - Check stack usage during decode to prevent crashing in excessively nested data structures. - Preallocate the required memory for json_append_string().
* Add support for growing strbufs exponentiallyMark Pulford2011-04-251-3/+8
| | | | | - Change default to 1024 byte strings and doubling in size - Add strbuf debug statistics
* Add functions for new strbuf API and tidyMark Pulford2011-04-151-13/+43
| | | | | | | | - Support strbuf_free() when strbuf is not dynamically created. - Ensure strbuf_free_to_string() returns a null terminated string. - Tidy API function naming. - Add strbuf_append_string(), strbuf_string(). - Allocate initial buffer in strbuf_init().
* Initial commitMark Pulford2011-04-151-0/+48
Split Lua JSON from parent project to create standalone module. Remove unnecesssary files from new repo.