Skip to content

Commit

Permalink
Fixed a bug in osc_atom_u_copyImpl where blobs were not being copied,…
Browse files Browse the repository at this point in the history
… potentially causing a double free
  • Loading branch information
maccallum committed Jul 16, 2023
1 parent cf17f03 commit a921279
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions osc_atom_u.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ void osc_atom_u_copyInto(t_osc_atom_u **dest, t_osc_atom_u *src)
aa->w.bndl = NULL;
osc_bundle_u_copy(&(aa->w.bndl), src->w.bndl);
break;
case 'b':
{
int32_t len = ntoh32(*((int32_t *)(src->w.b)));
int32_t size = osc_util_getPaddingForNBytes(len);
aa->w.s = osc_mem_alloc(size + 4);
memcpy(aa->w.b, src->w.b, len + 4);
}
break;
default:
// memcpy(&aa->w, &src->w, sizeof(union _word));
// printf("%s %i copied %p %p size %ld \n", __func__, __LINE__, &aa->w, &src->w, sizeof(union _word) );
Expand Down

0 comments on commit a921279

Please sign in to comment.