<feed xmlns='http://www.w3.org/2005/Atom'>
<title>samba.git/lib/replace/tests, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/'/>
<entry>
<title>lib:replace: Add test for memset_explicit()</title>
<updated>2025-11-11T13:46:42+00:00</updated>
<author>
<name>Douglas Bagnall</name>
<email>douglas.bagnall@catalyst.net.nz</email>
</author>
<published>2025-10-30T15:01:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=2b17c9816d4373eba365de803eec10435ea038d4'/>
<id>2b17c9816d4373eba365de803eec10435ea038d4</id>
<content type='text'>
Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix clang 20 format-truncation warnings</title>
<updated>2025-05-28T23:04:38+00:00</updated>
<author>
<name>Gary Lockyer</name>
<email>gary@catalyst.net.nz</email>
</author>
<published>2025-05-19T22:00:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=b6fede171ebd228539a3d879ec9d55d9b8901d89'/>
<id>b6fede171ebd228539a3d879ec9d55d9b8901d89</id>
<content type='text'>
Fix:
  lib/replace/tests/testsuite.c:387:6: error:
    'snprintf' will always be truncated; specified size is 3,
    but format string expands to at least 5 [-Werror,-Wformat-truncation]
  387 |         if (snprintf(tmp, 3, "foo%d", 9) != 4) {
      |             ^

As this is an explicit test of snprintf's truncation behaviour
the warning can be safely suppressed.

Signed-off-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Anoop C S &lt;anoopcs@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix:
  lib/replace/tests/testsuite.c:387:6: error:
    'snprintf' will always be truncated; specified size is 3,
    but format string expands to at least 5 [-Werror,-Wformat-truncation]
  387 |         if (snprintf(tmp, 3, "foo%d", 9) != 4) {
      |             ^

As this is an explicit test of snprintf's truncation behaviour
the warning can be safely suppressed.

Signed-off-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Anoop C S &lt;anoopcs@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>remove usage of bzero</title>
<updated>2025-01-02T17:01:30+00:00</updated>
<author>
<name>Michael Tokarev</name>
<email>mjt@tls.msk.ru</email>
</author>
<published>2024-11-18T12:00:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=bf1e1387ea4a136d06029863eb63b3b1db1c7db0'/>
<id>bf1e1387ea4a136d06029863eb63b3b1db1c7db0</id>
<content type='text'>
bzero() function has been deprecated for a long time.
In samba it is replaced with memset().  But samba also
provides common memory-zeroing macros, like ZERO_STRUCT().
In all places where bzero() is used, it actually meant to
zero a structure or an array.

So replace these bzero() calls with ZERO_STRUCT() or
ZERO_ARRAY() as appropriate, and remove bzero() replacement
and testing entirely.

While at it, also stop checking for presence of memset() -
this function is standard for a very long time, and the
only conditional where HAVE_MEMSET were used, was to
provide replacement for bzero() - in all other places
memset() is used unconditionally.

Signed-off-by: Michael Tokarev &lt;mjt@tls.msk.ru&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Pavel Filipenský &lt;pfilipensky@samba.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
bzero() function has been deprecated for a long time.
In samba it is replaced with memset().  But samba also
provides common memory-zeroing macros, like ZERO_STRUCT().
In all places where bzero() is used, it actually meant to
zero a structure or an array.

So replace these bzero() calls with ZERO_STRUCT() or
ZERO_ARRAY() as appropriate, and remove bzero() replacement
and testing entirely.

While at it, also stop checking for presence of memset() -
this function is standard for a very long time, and the
only conditional where HAVE_MEMSET were used, was to
provide replacement for bzero() - in all other places
memset() is used unconditionally.

Signed-off-by: Michael Tokarev &lt;mjt@tls.msk.ru&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Pavel Filipenský &lt;pfilipensky@samba.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>lib:replace: Properly check result of write() and read() (CID 1034925)</title>
<updated>2023-10-13T02:18:30+00:00</updated>
<author>
<name>Joseph Sutton</name>
<email>josephsutton@catalyst.net.nz</email>
</author>
<published>2023-10-06T00:49:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=8f4aa3508c0423a98dd2e75edb2f0afa1921fb28'/>
<id>8f4aa3508c0423a98dd2e75edb2f0afa1921fb28</id>
<content type='text'>
Signed-off-by: Joseph Sutton &lt;josephsutton@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Joseph Sutton &lt;josephsutton@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib:replace: Fix NULL issue reported by covscan</title>
<updated>2022-02-01T21:09:21+00:00</updated>
<author>
<name>Pavel Filipenský</name>
<email>pfilipen@redhat.com</email>
</author>
<published>2022-01-27T08:40:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=1905c77a080710dc06c9422e2654a6080d21daa5'/>
<id>1905c77a080710dc06c9422e2654a6080d21daa5</id>
<content type='text'>
Found by covscan. Coding style kept as in the rest of the file.

Signed-off-by: Pavel Filipenský &lt;pfilipen@redhat.com&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;

Autobuild-User(master): Jeremy Allison &lt;jra@samba.org&gt;
Autobuild-Date(master): Tue Feb  1 21:09:21 UTC 2022 on sn-devel-184
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Found by covscan. Coding style kept as in the rest of the file.

Signed-off-by: Pavel Filipenský &lt;pfilipen@redhat.com&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;

Autobuild-User(master): Jeremy Allison &lt;jra@samba.org&gt;
Autobuild-Date(master): Tue Feb  1 21:09:21 UTC 2022 on sn-devel-184
</pre>
</div>
</content>
</entry>
<entry>
<title>lib:replace: Fix trailing whitespace in os2_delete.c</title>
<updated>2022-02-01T20:13:29+00:00</updated>
<author>
<name>Pavel Filipenský</name>
<email>pfilipen@redhat.com</email>
</author>
<published>2022-01-27T08:39:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=ac3c8c536d5462de85bd90db4df73d8517a1051a'/>
<id>ac3c8c536d5462de85bd90db4df73d8517a1051a</id>
<content type='text'>
Signed-off-by: Pavel Filipenský &lt;pfilipen@redhat.com&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Pavel Filipenský &lt;pfilipen@redhat.com&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>testsuite: Fix build with gcc &gt;= 11.1.1</title>
<updated>2021-08-16T17:20:37+00:00</updated>
<author>
<name>Andreas Schneider</name>
<email>asn@samba.org</email>
</author>
<published>2021-08-16T10:42:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=1ce08f72a9e2558e8720b463e68174e430a67654'/>
<id>1ce08f72a9e2558e8720b463e68174e430a67654</id>
<content type='text'>
Pair-Programmed-With: Jeremy Allison &lt;jra@samba.org&gt;
Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Signed-off-by: Jeremy Allison &lt;jra@samba.org&gt;

Autobuild-User(master): Jeremy Allison &lt;jra@samba.org&gt;
Autobuild-Date(master): Mon Aug 16 17:20:37 UTC 2021 on sn-devel-184
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pair-Programmed-With: Jeremy Allison &lt;jra@samba.org&gt;
Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Signed-off-by: Jeremy Allison &lt;jra@samba.org&gt;

Autobuild-User(master): Jeremy Allison &lt;jra@samba.org&gt;
Autobuild-Date(master): Mon Aug 16 17:20:37 UTC 2021 on sn-devel-184
</pre>
</div>
</content>
</entry>
<entry>
<title>lib:replace: Remove trailing spaces from testsuite.c</title>
<updated>2021-08-16T16:28:36+00:00</updated>
<author>
<name>Andreas Schneider</name>
<email>asn@samba.org</email>
</author>
<published>2021-08-16T10:39:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=86fddfa3116a8dec86e02088a3abc3859f38a251'/>
<id>86fddfa3116a8dec86e02088a3abc3859f38a251</id>
<content type='text'>
Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib:replace: Do not build strndup test with gcc 11 or newer</title>
<updated>2021-05-07T06:23:32+00:00</updated>
<author>
<name>Andreas Schneider</name>
<email>asn@samba.org</email>
</author>
<published>2021-05-06T17:07:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=8f12793ca5e7c9aa7c23a17400986878ae110e70'/>
<id>8f12793ca5e7c9aa7c23a17400986878ae110e70</id>
<content type='text'>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14699

gcc11 with -O3 detects that the size is incorrect:

lib/replace/tests/testsuite.c:286:13: error: ‘strndup’ specified bound 10 exceeds source size 4 [-Werror=stringop-overread]
  286 |         x = strndup("bla", 10);
      |             ^~~~~~~~~~~~~~~~~~

Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Guenther Deschner &lt;gd@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14699

gcc11 with -O3 detects that the size is incorrect:

lib/replace/tests/testsuite.c:286:13: error: ‘strndup’ specified bound 10 exceeds source size 4 [-Werror=stringop-overread]
  286 |         x = strndup("bla", 10);
      |             ^~~~~~~~~~~~~~~~~~

Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Guenther Deschner &lt;gd@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib:replace: Fix a posible double free</title>
<updated>2021-04-27T17:51:36+00:00</updated>
<author>
<name>Andreas Schneider</name>
<email>asn@samba.org</email>
</author>
<published>2021-04-27T13:33:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=ca6a8037aa1b613f9b0e3df4d0a7908dc053f06e'/>
<id>ca6a8037aa1b613f9b0e3df4d0a7908dc053f06e</id>
<content type='text'>
CID 1477397

Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;

Autobuild-User(master): Jeremy Allison &lt;jra@samba.org&gt;
Autobuild-Date(master): Tue Apr 27 17:51:36 UTC 2021 on sn-devel-184
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
CID 1477397

Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;

Autobuild-User(master): Jeremy Allison &lt;jra@samba.org&gt;
Autobuild-Date(master): Tue Apr 27 17:51:36 UTC 2021 on sn-devel-184
</pre>
</div>
</content>
</entry>
</feed>
