Skip to content

Commit

Permalink
Fix some more seg-faults on encoding.
Browse files Browse the repository at this point in the history
  • Loading branch information
bwoodsend committed Feb 12, 2022
1 parent 7fd7dbf commit 86e5fa7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ultrajsonenc.c
Expand Up @@ -175,6 +175,7 @@ static FASTCALL_ATTR INLINE_PREFIX void FASTCALL_MSVC Buffer_AppendShortHexUnche

static int Buffer_EscapeStringUnvalidated (JSONObjectEncoder *enc, const char *io, const char *end)
{
Buffer_Reserve(enc, RESERVE_STRING(end - io));
char *of = (char *) enc->offset;

for (;;)
Expand Down Expand Up @@ -722,7 +723,7 @@ static void encode(JSOBJ obj, JSONObjectEncoder *enc, const char *name, size_t c
if (count > 0) {
// Reserve space for the indentation plus the newline and the closing
// bracket.
Buffer_Reserve (enc, enc->indent * enc->level + 2);
Buffer_Reserve (enc, enc->indent * enc->level + 4);
Buffer_AppendIndentNewlineUnchecked (enc);
Buffer_AppendIndentUnchecked (enc, enc->level);
}
Expand Down

0 comments on commit 86e5fa7

Please sign in to comment.