Commit 9717f982 authored by Marko Mäkelä's avatar Marko Mäkelä

rec_get_nth_def_field(): Avoid out-of-bounds access

parent 16671b41
...@@ -839,7 +839,8 @@ rec_get_nth_def_field( ...@@ -839,7 +839,8 @@ rec_get_nth_def_field(
ulint* len) ulint* len)
{ {
ut_ad(rec_offs_validate(rec, index, offsets)); ut_ad(rec_offs_validate(rec, index, offsets));
if (!rec_offs_nth_default(offsets, n)) { if (rec_offs_n_fields(offsets) > n
&& !rec_offs_nth_default(offsets, n)) {
return rec_get_nth_field(rec, offsets, n, len); return rec_get_nth_field(rec, offsets, n, len);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment