Mercurial > vim
changeset 8358:49d0e094cb93 v7.4.1471
commit https://github.com/vim/vim/commit/bf73b91c664488ca57e2b4a8eb9b1f36f6625bc7
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Mar 2 21:16:59 2016 +0100
patch 7.4.1471
Problem: Missing out-of-memory check. And Coverity warning.
Solution: Bail out when msg is NULL.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 02 Mar 2016 21:30:04 +0100 |
parents | d1cc355d581a |
children | 304c1f78b943 |
files | src/channel.c src/version.c |
diffstat | 2 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/channel.c +++ b/src/channel.c @@ -1516,6 +1516,9 @@ may_invoke_callback(channel_T *channel, * get everything we have. */ msg = channel_get_all(channel, part); + if (msg == NULL) + return FALSE; /* out of memory (and avoids Coverity warning) */ + argv[1].v_type = VAR_STRING; argv[1].vval.v_string = msg; }