mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.1.1025: checking NULL pointer after addition
Problem: Checking NULL pointer after addition. (Coverity)
Solution: First check for NULL, then add the column.
64c8ed366d
This commit is contained in:
parent
c5631338b1
commit
5c97bfb1e2
@ -6963,10 +6963,11 @@ char_u *reg_submatch(int no)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
s = reg_getline_submatch(lnum) + rsm.sm_mmatch->startpos[no].col;
|
||||
s = reg_getline_submatch(lnum);
|
||||
if (s == NULL) { // anti-crash check, cannot happen?
|
||||
break;
|
||||
}
|
||||
s += rsm.sm_mmatch->startpos[no].col;
|
||||
if (rsm.sm_mmatch->endpos[no].lnum == lnum) {
|
||||
// Within one line: take form start to end col.
|
||||
len = rsm.sm_mmatch->endpos[no].col - rsm.sm_mmatch->startpos[no].col;
|
||||
|
Loading…
Reference in New Issue
Block a user