Mercurial > hg
changeset 23959:c8e7fa41bfc5 stable
diffhelpers: verify hline was created before using it
Found with cpychecker.
author | Augie Fackler <augie@google.com> |
---|---|
date | Tue, 27 Jan 2015 10:07:04 -0500 |
parents | df463ca0adef |
children | bca4b6f126f2 |
files | mercurial/diffhelpers.c |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/diffhelpers.c Sun Jan 25 22:55:10 2015 -0500 +++ b/mercurial/diffhelpers.c Tue Jan 27 10:07:04 2015 -0500 @@ -34,6 +34,9 @@ sz -= 1; hline = PyBytes_FromStringAndSize(l, sz-1); + if (!hline) { + return NULL; + } if (c == ' ' || c == '+') { PyObject *rline = PyBytes_FromStringAndSize(l + 1, sz - 2); @@ -194,4 +197,3 @@ NULL, NULL); } #endif -