Skip to content

Commit

Permalink
Fix vuln OSV-2024-384
Browse files Browse the repository at this point in the history
  • Loading branch information
aled-ua authored and rurban committed Dec 24, 2024
1 parent 47a07e5 commit 56d392a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/in_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ json_fixed_string (Bit_Chain *restrict dat, const int len,
l, &dat->chain[t->start]);
// len = t->end - t->start;
free (str);
str = NULL;
goto normal;
}
str = (char *)realloc (str, dlen);
Expand All @@ -475,6 +476,7 @@ json_fixed_string (Bit_Chain *restrict dat, const int len,
{
char *p;
normal:
if (!str) return NULL;
if (l > len)
{
memcpy (str, &dat->chain[t->start], len);
Expand Down Expand Up @@ -3831,6 +3833,7 @@ json_R2004_Header (Bit_Chain *restrict dat, Dwg_Data *restrict dwg,
}
LOG_TRACE ("file_ID_string: \"%.*s\"\n", 12, _obj->file_ID_string)
free (s);
s = NULL;
}
else if (strEQc (key, "padding"))
{
Expand Down

0 comments on commit 56d392a

Please sign in to comment.