<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libgit2.git/src/integer.h, branch ethomson/github_actions</title>
<subtitle>github.com: libgit2/libgit2.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/'/>
<entry>
<title>integer: use int64_t's for checks</title>
<updated>2019-11-25T02:18:29+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2019-06-23T16:20:17+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=05237ee559486ae4416f3d12e4a422bd9183f7ea'/>
<id>05237ee559486ae4416f3d12e4a422bd9183f7ea</id>
<content type='text'>
Use int64_t internally for type visibility.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use int64_t internally for type visibility.
</pre>
</div>
</content>
</entry>
<entry>
<title>patch_parse: detect overflow when calculating old/new line position</title>
<updated>2019-10-21T18:07:42+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2019-10-21T16:56:59+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=37141ff7701e45ab0d97f311a4e0cc95cf527aa9'/>
<id>37141ff7701e45ab0d97f311a4e0cc95cf527aa9</id>
<content type='text'>
When the patch contains lines close to INT_MAX, then it may happen that
we end up with an integer overflow when calculating the line of the
current diff hunk. Reject such patches as unreasonable to avoid the
integer overflow.

As the calculation is performed on integers, we introduce two new
helpers `git__add_int_overflow` and `git__sub_int_overflow` that perform
the integer overflow check in a generic way.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the patch contains lines close to INT_MAX, then it may happen that
we end up with an integer overflow when calculating the line of the
current diff hunk. Reject such patches as unreasonable to avoid the
integer overflow.

As the calculation is performed on integers, we introduce two new
helpers `git__add_int_overflow` and `git__sub_int_overflow` that perform
the integer overflow check in a generic way.
</pre>
</div>
</content>
</entry>
<entry>
<title>commit_list: store in/out-degrees as uint16_t</title>
<updated>2019-10-03T10:23:52+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2019-10-03T07:39:42+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=5cf17e0f269387f8345201aef482a10c96490d95'/>
<id>5cf17e0f269387f8345201aef482a10c96490d95</id>
<content type='text'>
The commit list's in- and out-degrees are currently stored as `unsigned
short`. When assigning it the value of `git_array_size`, which returns
an `size_t`, this generates a warning on some Win32 platforms due to
loosing precision.

We could just cast the returned value of `git_array_size`, which would
work fine for 99.99% of all cases as commits typically have less than
2^16 parents. For crafted commits though we might end up with a wrong
value, and thus we should definitely check whether the array size
actually fits into the field.

To ease the check, let's convert the fields to store the degrees as
`uint16_t`. We shouldn't rely on such unspecific types anyway, as it may
lead to different behaviour across platforms. Furthermore, this commit
introduces a new `git__is_uint16` function to check whether it actually
fits -- if not, we return an error.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The commit list's in- and out-degrees are currently stored as `unsigned
short`. When assigning it the value of `git_array_size`, which returns
an `size_t`, this generates a warning on some Win32 platforms due to
loosing precision.

We could just cast the returned value of `git_array_size`, which would
work fine for 99.99% of all cases as commits typically have less than
2^16 parents. For crafted commits though we might end up with a wrong
value, and thus we should definitely check whether the array size
actually fits into the field.

To ease the check, let's convert the fields to store the degrees as
`uint16_t`. We shouldn't rely on such unspecific types anyway, as it may
lead to different behaviour across platforms. Furthermore, this commit
introduces a new `git__is_uint16` function to check whether it actually
fits -- if not, we return an error.
</pre>
</div>
</content>
</entry>
<entry>
<title>add with overflow: correct documentation</title>
<updated>2019-01-20T13:52:46+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2019-01-20T13:52:46+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=75444d97fd5bc13be922714f2977a483c5303286'/>
<id>75444d97fd5bc13be922714f2977a483c5303286</id>
<content type='text'>
Correct the documentation on the fallback add/multiply with overflow
functions.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Correct the documentation on the fallback add/multiply with overflow
functions.
</pre>
</div>
</content>
</entry>
<entry>
<title>add with overflow: use SizeTAdd on Windows</title>
<updated>2019-01-20T13:51:15+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2019-01-20T13:51:15+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=abbc07f12fdf1444c8aa0c161f3dfa8a494b7dff'/>
<id>abbc07f12fdf1444c8aa0c161f3dfa8a494b7dff</id>
<content type='text'>
Windows provides &lt;intsafe.h&gt; which provides "performant" add and
multiply with overflow operations.  Use them when possible.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Windows provides &lt;intsafe.h&gt; which provides "performant" add and
multiply with overflow operations.  Use them when possible.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove unused git__add_uint64_overflow</title>
<updated>2019-01-20T13:04:10+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2019-01-20T13:04:10+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=c6d47acfbfd514a12ac9fb14c87a247da7bfbf1d'/>
<id>c6d47acfbfd514a12ac9fb14c87a247da7bfbf1d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>add with overflow intrinsics: simplify tests</title>
<updated>2019-01-20T13:00:53+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2019-01-20T13:00:53+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=f04f1c7eedf2081c35dda71594a6072c6cc65694'/>
<id>f04f1c7eedf2081c35dda71594a6072c6cc65694</id>
<content type='text'>
Use the smallest unsigned type that is equivalent to `size_t` to
simplify the conditionals.  Error if we're on a system that we believe
offers builtins but we cannot determine which one to use.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use the smallest unsigned type that is equivalent to `size_t` to
simplify the conditionals.  Error if we're on a system that we believe
offers builtins but we cannot determine which one to use.
</pre>
</div>
</content>
</entry>
<entry>
<title>Let GCC use the add/mul overflow intrinsics</title>
<updated>2019-01-10T00:51:03+00:00</updated>
<author>
<name>lhchavez</name>
<email>lhchavez@lhchavez.com</email>
</author>
<published>2019-01-09T01:32:23+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=2848923a2f5099b6d105b0b30212134d84377dee'/>
<id>2848923a2f5099b6d105b0b30212134d84377dee</id>
<content type='text'>
This change tweaks the macros for git__{add,multiply}_sizet_overflow so
that GCC can use them.

It also stops using the uadd,umul versions since the add,mul can handle
way more cases.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change tweaks the macros for git__{add,multiply}_sizet_overflow so
that GCC can use them.

It also stops using the uadd,umul versions since the add,mul can handle
way more cases.
</pre>
</div>
</content>
</entry>
<entry>
<title>consistent header guards</title>
<updated>2018-02-01T23:56:33+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2018-02-01T23:55:48+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=abb04caa2f74bb4783eb87202a904c0c3517df85'/>
<id>abb04caa2f74bb4783eb87202a904c0c3517df85</id>
<content type='text'>
use consistent names for the #include / #define header guard pattern.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
use consistent names for the #include / #define header guard pattern.
</pre>
</div>
</content>
</entry>
<entry>
<title>mac: on 32 bit, use `__builtin_umull_overflow`</title>
<updated>2017-01-23T22:29:58+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@github.com</email>
</author>
<published>2017-01-22T01:42:45+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=a0d384798312df3b2c79194ced81bf5a3d2afddc'/>
<id>a0d384798312df3b2c79194ced81bf5a3d2afddc</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
