Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP1:GA
mercurial.8017
hg-mpatch-fix05.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File hg-mpatch-fix05.patch of Package mercurial.8017
# HG changeset patch # User Augie Fackler <augie@google.com> # Date 1525366460 14400 # Node ID b8b253aec9538b2614295f6ba4ecefe335ad8bf5 # Parent 1ec4cb8cbc87004ffbeeb1b5d98acef04c38d59a mpatch: introduce a safesub() helper as well Same reason as safeadd(). diff -r 1ec4cb8cbc87 -r b8b253aec953 mercurial/mpatch.c --- a/mercurial/mpatch.c Mon Apr 30 22:13:42 2018 -0400 +++ b/mercurial/mpatch.c Thu May 03 12:54:20 2018 -0400 @@ -88,6 +88,17 @@ return true; } +/* subtract src from dest and store result in dest */ +static inline bool safesub(int src, int *dest) +{ + if (((src > 0) && (*dest < INT_MIN + src)) || + ((src < 0) && (*dest > INT_MAX + src))) { + return false; + } + *dest -= src; + return true; +} + /* move hunks in source that are less cut to dest, compensating for changes in offset. the last hunk may be split if necessary. */
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor