Skip to content

Commit 56d392a

Browse files
oss-patchrurban
authored andcommitted
Fix vuln OSV-2024-384
1 parent 47a07e5 commit 56d392a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/in_json.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ json_fixed_string (Bit_Chain *restrict dat, const int len,
463463
l, &dat->chain[t->start]);
464464
// len = t->end - t->start;
465465
free (str);
466+
str = NULL;
466467
goto normal;
467468
}
468469
str = (char *)realloc (str, dlen);
@@ -475,6 +476,7 @@ json_fixed_string (Bit_Chain *restrict dat, const int len,
475476
{
476477
char *p;
477478
normal:
479+
if (!str) return NULL;
478480
if (l > len)
479481
{
480482
memcpy (str, &dat->chain[t->start], len);
@@ -3831,6 +3833,7 @@ json_R2004_Header (Bit_Chain *restrict dat, Dwg_Data *restrict dwg,
38313833
}
38323834
LOG_TRACE ("file_ID_string: \"%.*s\"\n", 12, _obj->file_ID_string)
38333835
free (s);
3836+
s = NULL;
38343837
}
38353838
else if (strEQc (key, "padding"))
38363839
{

0 commit comments

Comments
 (0)