From 21d40475bb68b2e6f36f29a1995c8d3aba79d5bf Mon Sep 17 00:00:00 2001 From: Eliseo Martínez Date: Thu, 30 Apr 2015 10:07:07 +0200 Subject: Fix warnings: ex_cmds2.c: ex_listdo(): Np dereference: FP. Problem : Dereference of null pointer @ 1903. Diagnostic : False positive. Rationale : Suggested error path first assumes wp == NULL and later one win_valid(wp), which is not possible. Resolution : Assert wp != NULL if win_valid(wp). --- src/nvim/ex_cmds2.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index e453d68247..83f693ec14 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -1897,6 +1897,7 @@ void ex_listdo(exarg_T *eap) /* go to window "wp" */ if (!win_valid(wp)) break; + assert(wp); win_goto(wp); if (curwin != wp) break; /* something must be wrong */ -- cgit From 33adbf31399c7069386b6c72f9d15e67f9f569e0 Mon Sep 17 00:00:00 2001 From: Eliseo Martínez Date: Thu, 30 Apr 2015 10:13:53 +0200 Subject: Fix warnings: ex_cmds2.c: ex_listdo(): Np dereference: FP. Problem : Dereference of null pointer @ 1909. Diagnostic : False positive. Rationale : Suggested path error first assumes tp == NULL and later one valid_tabpage(tp), which is not possible. Resolution : Assert tp != NULL if valid_tabpage(tp). --- src/nvim/ex_cmds2.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index 83f693ec14..b79d09885c 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -1906,6 +1906,7 @@ void ex_listdo(exarg_T *eap) /* go to window "tp" */ if (!valid_tabpage(tp)) break; + assert(tp); goto_tabpage_tp(tp, TRUE, TRUE); tp = tp->tp_next; } else if (eap->cmdidx == CMD_bufdo) { -- cgit From 1eaaff3fc5b96daa366c67a5ee066a5eb000bb56 Mon Sep 17 00:00:00 2001 From: Eliseo Martínez Date: Thu, 30 Apr 2015 10:42:05 +0200 Subject: Fix warnings: ex_docmd.c: ex_tabonly(): Np dereference: FP. Problem : Dereference of null pointer @ 5816. Diagnostic : False positive. Rationale : first_tabpage is assumed to be NULL after calling goto_tabpage(), which should not be possible (first_tabpage should be not NULL before calling it, and only changed to another valid tab page). Resolution : Assert first_tabpage after calling goto_tabpage(). Helped-by: oni-link --- src/nvim/ex_docmd.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 646d64f9f8..e81f99ccea 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -5813,6 +5813,7 @@ static void ex_tabonly(exarg_T *eap) break; } } + assert(first_tabpage); if (first_tabpage->tp_next == NULL) { break; } -- cgit