Commit 484e776
builtin/apply: handle parse_binary() failure
In parse_binary() there is:
forward = parse_binary_hunk(&buffer, &size, &status, &used);
if (!forward && !status)
/* there has to be one hunk (forward hunk) */
return error(_("unrecognized binary patch at line %d"), linenr-1);
so parse_binary() can return -1, because that's what error() returns.
Also parse_binary_hunk() sets "status" to -1 in case of error and
parse_binary() does "if (status) return status;".
In this case parse_chunk() should not add -1 to the patchsize it computes.
It is better for future libification efforts to make it just return -1.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent db354b7 commit 484e776
1 file changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1863 | 1863 | | |
1864 | 1864 | | |
1865 | 1865 | | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
1866 | 1871 | | |
1867 | 1872 | | |
1868 | 1873 | | |
| |||
2008 | 2013 | | |
2009 | 2014 | | |
2010 | 2015 | | |
| 2016 | + | |
| 2017 | + | |
2011 | 2018 | | |
2012 | 2019 | | |
2013 | 2020 | | |
| |||
0 commit comments