comparison src/regexp_nfa.c @ 26652:a3f38923c037 v8.2.3855

patch 8.2.3855: illegal memory access when displaying a blob Commit: https://github.com/vim/vim/commit/bc404bfb32cf2bef34050d2aeae0ea72ccf980cc Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Sun Dec 19 19:19:31 2021 +0000 patch 8.2.3855: illegal memory access when displaying a blob Problem: Illegal memory access when displaying a blob. Solution: Append a NUL at the end. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/9372)
author Bram Moolenaar <Bram@vim.org>
date Sun, 19 Dec 2021 20:30:03 +0100
parents 9f445e07f766
children fc859aea8cec
comparison
equal deleted inserted replaced
26651:ac5f53e8cf77 26652:a3f38923c037
2915 indent->ga_len -= 1; 2915 indent->ga_len -= 1;
2916 if (state->out1) 2916 if (state->out1)
2917 ga_concat(indent, (char_u *)"| "); 2917 ga_concat(indent, (char_u *)"| ");
2918 else 2918 else
2919 ga_concat(indent, (char_u *)" "); 2919 ga_concat(indent, (char_u *)" ");
2920 ga_append(indent, '\0'); 2920 ga_append(indent, NUL);
2921 2921
2922 nfa_print_state2(debugf, state->out, indent); 2922 nfa_print_state2(debugf, state->out, indent);
2923 2923
2924 // replace last part of indent for state->out1 2924 // replace last part of indent for state->out1
2925 indent->ga_len -= 3; 2925 indent->ga_len -= 3;
2926 ga_concat(indent, (char_u *)" "); 2926 ga_concat(indent, (char_u *)" ");
2927 ga_append(indent, '\0'); 2927 ga_append(indent, NUL);
2928 2928
2929 nfa_print_state2(debugf, state->out1, indent); 2929 nfa_print_state2(debugf, state->out1, indent);
2930 2930
2931 // shrink indent 2931 // shrink indent
2932 indent->ga_len -= 3; 2932 indent->ga_len -= 3;
2933 ga_append(indent, '\0'); 2933 ga_append(indent, NUL);
2934 } 2934 }
2935 2935
2936 /* 2936 /*
2937 * Print the NFA state machine. 2937 * Print the NFA state machine.
2938 */ 2938 */