<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libgit2.git/tests/apply, branch ethomson/codeql</title>
<subtitle>github.com: libgit2/libgit2.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/'/>
<entry>
<title>apply: add GIT_APPLY_CHECK</title>
<updated>2019-10-22T14:23:24+00:00</updated>
<author>
<name>Drew DeVault</name>
<email>sir@cmpwn.com</email>
</author>
<published>2019-09-14T18:03:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=02af1fcb69b91b3532b8b253ec82cdfce17ef28d'/>
<id>02af1fcb69b91b3532b8b253ec82cdfce17ef28d</id>
<content type='text'>
This adds an option which will check if a diff is applicable without
actually applying it; equivalent to git apply --check.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds an option which will check if a diff is applicable without
actually applying it; equivalent to git apply --check.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #5209 from mkostyuk/apply-wrong-patch</title>
<updated>2019-09-09T11:10:24+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2019-09-09T11:10:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=c3a7892f30fea72692fafae0e6ff567e5cb8726c'/>
<id>c3a7892f30fea72692fafae0e6ff567e5cb8726c</id>
<content type='text'>
apply: Fix a patch corruption related to EOFNL handling</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
apply: Fix a patch corruption related to EOFNL handling</pre>
</div>
</content>
</entry>
<entry>
<title>apply: Test for EOFNL mishandling when several hunks are processed</title>
<updated>2019-08-28T20:18:31+00:00</updated>
<author>
<name>Max Kostyukevich</name>
<email>maxim.kostyukevich@mera.com</email>
</author>
<published>2019-08-28T20:18:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=585fbd74d2bdd0789c62cb9f12452898a9cbecae'/>
<id>585fbd74d2bdd0789c62cb9f12452898a9cbecae</id>
<content type='text'>
Introduce an unit test to validate that git_apply__patch() properly
handles EOFNL changes in case of patches with several hunks.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduce an unit test to validate that git_apply__patch() properly
handles EOFNL changes in case of patches with several hunks.
</pre>
</div>
</content>
</entry>
<entry>
<title>apply: free test data</title>
<updated>2019-08-27T17:10:53+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2019-08-27T17:10:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=5498c318a247d5ceb8b2cca6838796fa631cf0a6'/>
<id>5498c318a247d5ceb8b2cca6838796fa631cf0a6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>apply: Test for git_apply_to_tree failures when new files are added</title>
<updated>2019-08-21T12:03:50+00:00</updated>
<author>
<name>Max Kostyukevich</name>
<email>maxim.kostyukevich@mera.com</email>
</author>
<published>2019-08-21T12:03:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=dceedbb809cfef67d308a033fb1ffed8b4adebb9'/>
<id>dceedbb809cfef67d308a033fb1ffed8b4adebb9</id>
<content type='text'>
Introduce an unit test to validate if git_apply_to_tree() fails when an
applied patch adds new files.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduce an unit test to validate if git_apply_to_tree() fails when an
applied patch adds new files.
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: apply: verify that we correctly truncate the source buffer</title>
<updated>2019-02-21T08:24:25+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2019-02-21T07:30:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=966b944095edf9910a332bb73249b5d7d6ebeb2f'/>
<id>966b944095edf9910a332bb73249b5d7d6ebeb2f</id>
<content type='text'>
Previously, we would fail to correctly truncate the source buffer
if the source has more than one line and ends with a non-newline
character. In the following call, we thus truncate the source
string in the middle of the second line. Without the bug fixed,
we would successfully apply the patch to the source and return
success. With the overflow being fixed, we should return an
error now.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, we would fail to correctly truncate the source buffer
if the source has more than one line and ends with a non-newline
character. In the following call, we thus truncate the source
string in the middle of the second line. Without the bug fixed,
we would successfully apply the patch to the source and return
success. With the overflow being fixed, we should return an
error now.
</pre>
</div>
</content>
</entry>
<entry>
<title>index: use new enum and structure names</title>
<updated>2018-12-01T10:46:44+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2018-11-28T13:31:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=18e71e6d597abe6c7feb666429c921bd19dc0ba8'/>
<id>18e71e6d597abe6c7feb666429c921bd19dc0ba8</id>
<content type='text'>
Use the new-style index names throughout our own codebase.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use the new-style index names throughout our own codebase.
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: move apply_helpers functions into own compilation unit</title>
<updated>2018-11-28T14:22:27+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2018-11-21T10:18:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=14a9a4f34638cb4b1c56b0e229692b0869f3514b'/>
<id>14a9a4f34638cb4b1c56b0e229692b0869f3514b</id>
<content type='text'>
Currently, the "apply_helper" functions used for testing the apply logic are all
statically defined in the "apply_helpers.h" header file. This may lead to
warnings from the compiler in case where this header file is included, but not
all functions it brings along are used in the compilation unit where it has been
included into.

Fix these potential warnings by moving the implementation into its own
compilation unit "apply_helpers.c".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, the "apply_helper" functions used for testing the apply logic are all
statically defined in the "apply_helpers.h" header file. This may lead to
warnings from the compiler in case where this header file is included, but not
all functions it brings along are used in the compilation unit where it has been
included into.

Fix these potential warnings by moving the implementation into its own
compilation unit "apply_helpers.c".
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #4847 from noahp/noahp/null-arg-fixes</title>
<updated>2018-11-18T23:15:56+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2018-11-18T23:15:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=646a94be5f01001e09796d03d5f6c077b21b9532'/>
<id>646a94be5f01001e09796d03d5f6c077b21b9532</id>
<content type='text'>
tests: 🌀 address two null argument instances</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
tests: 🌀 address two null argument instances</pre>
</div>
</content>
</entry>
<entry>
<title>tests: address two null argument instances</title>
<updated>2018-11-13T13:22:25+00:00</updated>
<author>
<name>Noah Pendleton</name>
<email>2538614+noahp@users.noreply.github.com</email>
</author>
<published>2018-11-13T13:22:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=f127ce3505e308788dd12dcda9b18dc208da1220'/>
<id>f127ce3505e308788dd12dcda9b18dc208da1220</id>
<content type='text'>
Handle two null argument cases that occur in the unit tests.
One is in library code, the other is in test code.

Detected by running unit tests with undefined behavior sanitizer:
```bash
 # build
mkdir build &amp;&amp; cd build
cmake -DBUILD_CLAR=ON -DCMAKE_C_FLAGS="-fsanitize=address \
-fsanitize=undefined -fstack-usage -static-libasan" ..
cmake --build .

 # run with asan
ASAN_OPTIONS="allocator_may_return_null=1" ./libgit2_clar
...
............../libgit2/src/apply.c:316:3: runtime error: null pointer \
passed as argument 1, which is declared to never be null
...................../libgit2/tests/apply/fromfile.c:46:3: runtime \
error: null pointer passed as argument 1, which is declared to never be null
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Handle two null argument cases that occur in the unit tests.
One is in library code, the other is in test code.

Detected by running unit tests with undefined behavior sanitizer:
```bash
 # build
mkdir build &amp;&amp; cd build
cmake -DBUILD_CLAR=ON -DCMAKE_C_FLAGS="-fsanitize=address \
-fsanitize=undefined -fstack-usage -static-libasan" ..
cmake --build .

 # run with asan
ASAN_OPTIONS="allocator_may_return_null=1" ./libgit2_clar
...
............../libgit2/src/apply.c:316:3: runtime error: null pointer \
passed as argument 1, which is declared to never be null
...................../libgit2/tests/apply/fromfile.c:46:3: runtime \
error: null pointer passed as argument 1, which is declared to never be null
```
</pre>
</div>
</content>
</entry>
</feed>
