<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib, branch stable/8</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>MFC r362623:</title>
<updated>2020-06-30T15:53:52+00:00</updated>
<author>
<name>Dimitry Andric</name>
<email>dim@FreeBSD.org</email>
</author>
<published>2020-06-30T15:53:52+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=c36d306bb0defd6dd6a1d01cfdb1dd511368ca4d'/>
<id>c36d306bb0defd6dd6a1d01cfdb1dd511368ca4d</id>
<content type='text'>
Fix copy/paste mistake in kvm_getswapinfo(3)

It seems this manpage was copied from kvm_getloadavg(3), but the
DIAGNOSTICS section was not updated completely. Update the section with
correct information about a return value of -1.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix copy/paste mistake in kvm_getswapinfo(3)

It seems this manpage was copied from kvm_getloadavg(3), but the
DIAGNOSTICS section was not updated completely. Update the section with
correct information about a return value of -1.
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r352710:</title>
<updated>2019-09-28T08:57:29+00:00</updated>
<author>
<name>Dimitry Andric</name>
<email>dim@FreeBSD.org</email>
</author>
<published>2019-09-28T08:57:29+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=bc4f7cabbe20fbc3ca6bff0daaca1dcba4bc72ac'/>
<id>bc4f7cabbe20fbc3ca6bff0daaca1dcba4bc72ac</id>
<content type='text'>
Do not left-shift a negative number (inducing undefined behavior in
C/C++) in exp(3), expf(3), expm1(3) and expm1f(3) during intermediate
computations that compute the IEEE-754 bit pattern for |2**k| for
integer |k|.

The implementations of exp(3), expf(3), expm1(3) and expm1f(3) need to
compute IEEE-754 bit patterns for 2**k in certain places.  (k is an
integer and 2**k is exactly representable in IEEE-754.)

Currently they do things like 0x3FF0'0000+(k&lt;&lt;20), which is to say they
take the bit pattern representing 1 and then add directly to the
exponent field to get the desired power of two.  This is fine when k is
non-negative.

But when k&lt;0 (and certain classes of input trigger this), this
left-shifts a negative number -- an operation with undefined behavior in
C and C++.

The desired semantics can be achieved by instead adding the
possibly-negative k to the IEEE-754 exponent bias to get the desired
exponent field, _then_ shifting that into its proper overall position.

(Note that in case of s_expm1.c and s_expm1f.c, there are SET_HIGH_WORD
and SET_FLOAT_WORD uses further down in each of these files that perform
shift operations involving k, but by these points k's range has been
restricted to 2 &lt; k &lt;= 56, and the shift operations under those
circumstances can't do anything that would be UB.)

Submitted by:	Jeff Walden, https://github.com/jswalden
Obtained from:	https://github.com/freebsd/freebsd/pull/411
Obtained from:	https://github.com/freebsd/freebsd/pull/412
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Do not left-shift a negative number (inducing undefined behavior in
C/C++) in exp(3), expf(3), expm1(3) and expm1f(3) during intermediate
computations that compute the IEEE-754 bit pattern for |2**k| for
integer |k|.

The implementations of exp(3), expf(3), expm1(3) and expm1f(3) need to
compute IEEE-754 bit patterns for 2**k in certain places.  (k is an
integer and 2**k is exactly representable in IEEE-754.)

Currently they do things like 0x3FF0'0000+(k&lt;&lt;20), which is to say they
take the bit pattern representing 1 and then add directly to the
exponent field to get the desired power of two.  This is fine when k is
non-negative.

But when k&lt;0 (and certain classes of input trigger this), this
left-shifts a negative number -- an operation with undefined behavior in
C and C++.

The desired semantics can be achieved by instead adding the
possibly-negative k to the IEEE-754 exponent bias to get the desired
exponent field, _then_ shifting that into its proper overall position.

(Note that in case of s_expm1.c and s_expm1f.c, there are SET_HIGH_WORD
and SET_FLOAT_WORD uses further down in each of these files that perform
shift operations involving k, but by these points k's range has been
restricted to 2 &lt; k &lt;= 56, and the shift operations under those
circumstances can't do anything that would be UB.)

Submitted by:	Jeff Walden, https://github.com/jswalden
Obtained from:	https://github.com/freebsd/freebsd/pull/411
Obtained from:	https://github.com/freebsd/freebsd/pull/412
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r305284:</title>
<updated>2016-09-09T06:33:56+00:00</updated>
<author>
<name>Hans Petter Selasky</name>
<email>hselasky@FreeBSD.org</email>
</author>
<published>2016-09-09T06:33:56+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=5b4770cc138cd9160eef62a0df9c3ff65e241532'/>
<id>5b4770cc138cd9160eef62a0df9c3ff65e241532</id>
<content type='text'>
Fix array size issue when using the pre-scaling feature for
ISOCHRONOUS USB transfers. Make sure enough length and buffer pointers
are allocated when setting up the libusb transfer structure to support
the maximum number of frames the kernel can handle.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix array size issue when using the pre-scaling feature for
ISOCHRONOUS USB transfers. Make sure enough length and buffer pointers
are allocated when setting up the libusb transfer structure to support
the maximum number of frames the kernel can handle.
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r301842:</title>
<updated>2016-06-29T10:47:44+00:00</updated>
<author>
<name>Hans Petter Selasky</name>
<email>hselasky@FreeBSD.org</email>
</author>
<published>2016-06-29T10:47:44+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=de6e36c8d6967cb02d18f1d3e73fa82e87bcd6a8'/>
<id>de6e36c8d6967cb02d18f1d3e73fa82e87bcd6a8</id>
<content type='text'>
Implement code to stop all USB endpoints before executing a USB device
reset command, alternate setting command or set configuration
command. Else LibUSB v1.0 will not re-open the endpoints which the
kernel closes and the USB application might wait infinitely for
transfers to complete.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implement code to stop all USB endpoints before executing a USB device
reset command, alternate setting command or set configuration
command. Else LibUSB v1.0 will not re-open the endpoints which the
kernel closes and the USB application might wait infinitely for
transfers to complete.
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r293856:</title>
<updated>2016-01-22T00:13:18+00:00</updated>
<author>
<name>Brooks Davis</name>
<email>brooks@FreeBSD.org</email>
</author>
<published>2016-01-22T00:13:18+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=65ef8d1f4ca27fd4f88bcc17e4d37f9285b4b8ed'/>
<id>65ef8d1f4ca27fd4f88bcc17e4d37f9285b4b8ed</id>
<content type='text'>
Avoid reading pass the end of the source buffer when it is not NUL
terminated.

If this buffer is adjacent to an unmapped page or a version of C with
bounds checked is used this may result in a crash.

PR:		206178
Submitted by:	Alexander Cherepanov &lt;cherepan@mccme.ru&gt;
Requested by:	danfe
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Avoid reading pass the end of the source buffer when it is not NUL
terminated.

If this buffer is adjacent to an unmapped page or a version of C with
bounds checked is used this may result in a crash.

PR:		206178
Submitted by:	Alexander Cherepanov &lt;cherepan@mccme.ru&gt;
Requested by:	danfe
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r293855:</title>
<updated>2016-01-22T00:08:16+00:00</updated>
<author>
<name>Brooks Davis</name>
<email>brooks@FreeBSD.org</email>
</author>
<published>2016-01-22T00:08:16+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=fa6179d17d705b5bc73a89bceb147a9ed9a0b3d1'/>
<id>fa6179d17d705b5bc73a89bceb147a9ed9a0b3d1</id>
<content type='text'>
Avoid reading pass the end of the source buffer when it is not NUL
terminated.

If this buffer is adjacent to an unmapped page or a version of C with
bounds checked is used this may result in a crash.

PR:		206177
Submitted by:	Alexander Cherepanov &lt;cherepan@mccme.ru&gt;
Requested by:	danfe
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Avoid reading pass the end of the source buffer when it is not NUL
terminated.

If this buffer is adjacent to an unmapped page or a version of C with
bounds checked is used this may result in a crash.

PR:		206177
Submitted by:	Alexander Cherepanov &lt;cherepan@mccme.ru&gt;
Requested by:	danfe
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r286515:</title>
<updated>2015-08-12T19:06:35+00:00</updated>
<author>
<name>Dimitry Andric</name>
<email>dim@FreeBSD.org</email>
</author>
<published>2015-08-12T19:06:35+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=66f64dc478deb50628a32acc19e48a69ec42f1cf'/>
<id>66f64dc478deb50628a32acc19e48a69ec42f1cf</id>
<content type='text'>
In libm's exp2(3), avoid left-shifting a negative integer, which is
undefined.  Replace it with the intended value, in a defined way.

Reviewed by:	bde
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In libm's exp2(3), avoid left-shifting a negative integer, which is
undefined.  Replace it with the intended value, in a defined way.

Reviewed by:	bde
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC: libsm/path.c is about to disappear in the merge of sendmail 8.15.2.  It</title>
<updated>2015-07-11T03:29:04+00:00</updated>
<author>
<name>Gregory Neil Shapiro</name>
<email>gshapiro@FreeBSD.org</email>
</author>
<published>2015-07-11T03:29:04+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=6248784a23017e9b6c9c93ee0fe7a2de9b0811d2'/>
<id>6248784a23017e9b6c9c93ee0fe7a2de9b0811d2</id>
<content type='text'>
     is an empty file now so it is safe to remove before the merge.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
     is an empty file now so it is safe to remove before the merge.
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r284237,r284277:</title>
<updated>2015-06-24T23:05:17+00:00</updated>
<author>
<name>Xin LI</name>
<email>delphij@FreeBSD.org</email>
</author>
<published>2015-06-24T23:05:17+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ec51edce97a16eb5f508a9232352b81ae0e86499'/>
<id>ec51edce97a16eb5f508a9232352b81ae0e86499</id>
<content type='text'>
file 5.23.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
file 5.23.
</pre>
</div>
</content>
</entry>
<entry>
<title>MFC r284346:</title>
<updated>2015-06-20T13:30:09+00:00</updated>
<author>
<name>Dimitry Andric</name>
<email>dim@FreeBSD.org</email>
</author>
<published>2015-06-20T13:30:09+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=125ff53fa1c1377b720910223f994ea825c90b60'/>
<id>125ff53fa1c1377b720910223f994ea825c90b60</id>
<content type='text'>
Fix the following clang 3.7.0 warnings in lib/libfetch/http.c:

    lib/libfetch/http.c:1628:26: error: address of array 'purl-&gt;user'
    will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                                    aparams.user = purl-&gt;user ?
                                                   ~~~~~~^~~~ ~
    lib/libfetch/http.c:1630:30: error: address of array 'purl-&gt;pwd'
    will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                                    aparams.password = purl-&gt;pwd?
                                                       ~~~~~~^~~~
    lib/libfetch/http.c:1657:25: error: address of array 'url-&gt;user'
    will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                                    aparams.user = url-&gt;user ?
                                                   ~~~~~^~~~ ~
    lib/libfetch/http.c:1659:29: error: address of array 'url-&gt;pwd'
    will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                                    aparams.password = url-&gt;pwd ?
                                                       ~~~~~^~~ ~
    lib/libfetch/http.c:1669:25: error: address of array 'url-&gt;user'
    will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                                    aparams.user = url-&gt;user ?
                                                   ~~~~~^~~~ ~
    lib/libfetch/http.c:1671:29: error: address of array 'url-&gt;pwd'
    will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                                    aparams.password = url-&gt;pwd ?
                                                       ~~~~~^~~ ~

Since url-&gt;user and url-&gt;pwd are arrays, they can never be NULL, so the
checks can be removed.

Reviewed by:	bapt
Differential Revision: https://reviews.freebsd.org/D2673
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix the following clang 3.7.0 warnings in lib/libfetch/http.c:

    lib/libfetch/http.c:1628:26: error: address of array 'purl-&gt;user'
    will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                                    aparams.user = purl-&gt;user ?
                                                   ~~~~~~^~~~ ~
    lib/libfetch/http.c:1630:30: error: address of array 'purl-&gt;pwd'
    will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                                    aparams.password = purl-&gt;pwd?
                                                       ~~~~~~^~~~
    lib/libfetch/http.c:1657:25: error: address of array 'url-&gt;user'
    will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                                    aparams.user = url-&gt;user ?
                                                   ~~~~~^~~~ ~
    lib/libfetch/http.c:1659:29: error: address of array 'url-&gt;pwd'
    will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                                    aparams.password = url-&gt;pwd ?
                                                       ~~~~~^~~ ~
    lib/libfetch/http.c:1669:25: error: address of array 'url-&gt;user'
    will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                                    aparams.user = url-&gt;user ?
                                                   ~~~~~^~~~ ~
    lib/libfetch/http.c:1671:29: error: address of array 'url-&gt;pwd'
    will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                                    aparams.password = url-&gt;pwd ?
                                                       ~~~~~^~~ ~

Since url-&gt;user and url-&gt;pwd are arrays, they can never be NULL, so the
checks can be removed.

Reviewed by:	bapt
Differential Revision: https://reviews.freebsd.org/D2673
</pre>
</div>
</content>
</entry>
</feed>
