Skip to content

Commit

Permalink
fix memory corruption in deleteat! (#41646)
Browse files Browse the repository at this point in the history
n.b. `n == a->nrows + dec`

Fixes JuliaData/DataFrames.jl#2819
  • Loading branch information
vtjnash authored Jul 21, 2021
1 parent ed93e30 commit 2e06a01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ STATIC_INLINE void jl_array_del_at_beg(jl_array_t *a, size_t idx, size_t dec,
// Move the rest of the data if the offset changed
if (newoffs != offset) {
memmove_safe(a->flags.hasptr, newdata + nb1, olddata + nb1 + nbdec, nbtotal - nb1);
if (isbitsunion) memmove(newtypetagdata + idx, typetagdata + idx + dec, n - idx);
if (isbitsunion) memmove(newtypetagdata + idx, typetagdata + idx + dec, a->nrows - idx);
}
a->data = newdata;
}
Expand Down

0 comments on commit 2e06a01

Please sign in to comment.