fix: avoid accessing unowned memory (#17)

This commit is contained in:
David Hotham 2021-01-01 13:10:07 +00:00 committed by GitHub
parent da23114377
commit 45ecb42abc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -655,9 +655,10 @@ struct Scanner {
bool allow_comment = !(VLD[R_DQT_STR_CTN] || VLD[BR_DQT_STR_CTN] || VLD[R_SQT_STR_CTN] || VLD[BR_SQT_STR_CTN]);
int16_t *ind_ptr = &ind_len_stk.back();
int16_t cur_ind = *ind_ptr--;
int16_t prt_ind = *ind_ptr;
vector<int16_t>::reverse_iterator ind_ptr = ind_len_stk.rbegin();
vector<int16_t>::reverse_iterator ind_end = ind_len_stk.rend();
int16_t cur_ind = *ind_ptr++;
int16_t prt_ind = ind_ptr == ind_end ? -1 : *ind_ptr;
int16_t cur_ind_typ = ind_typ_stk.back();
bool has_tab_ind = false;