<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libc/stdlib/strfmon.c, branch release/13.1.0</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=release%2F13.1.0</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=release%2F13.1.0'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2020-09-02T20:04:26Z</updated>
<entry>
<title>Compute the correct size of the string to move forward.</title>
<updated>2020-09-02T20:04:26Z</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2020-09-02T20:04:26Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=1a4531bc98da1de16bed68ecba051d6bf3a4764f'/>
<id>urn:sha1:1a4531bc98da1de16bed68ecba051d6bf3a4764f</id>
<content type='text'>
Previously this was counting the amount of spare room at the start of
the buffer that the string needed to move forward and passing that as
the number of bytes to copy to memmove rather than the length of the
string to be copied.

In the strfmon test in the test suite this caused the memmove to
overflow the allocated buffer by one byte which CHERI caught.

Reported by:	CHERI
Reviewed by:	kevans
Obtained from:	CheriBSD
MFC after:	1 week
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D26280
</content>
</entry>
<entry>
<title>Allow multi-byte thousands separators in strfmon(3)</title>
<updated>2018-12-19T22:57:47Z</updated>
<author>
<name>Conrad Meyer</name>
<email>cem@FreeBSD.org</email>
</author>
<published>2018-12-19T22:57:47Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=8c1c50ff8793fe27d9389f4f408e6a11a1f9fc53'/>
<id>urn:sha1:8c1c50ff8793fe27d9389f4f408e6a11a1f9fc53</id>
<content type='text'>
PR:	234010
Reported by:	Jon Tejnung &lt;jon AT herrskogen.se&gt;
Reviewed by:	yuripv
Differential Revision:	https://reviews.freebsd.org/D18605
</content>
</entry>
<entry>
<title>libc: further adoption of SPDX licensing ID tags.</title>
<updated>2017-11-25T17:12:48Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2017-11-25T17:12:48Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d915a14ef094c8dfc1a5aee70e135abfec01d0f1'/>
<id>urn:sha1:d915a14ef094c8dfc1a5aee70e135abfec01d0f1</id>
<content type='text'>
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using mis-identified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
</content>
</entry>
<entry>
<title>libc: spelling fixes.</title>
<updated>2016-04-30T01:24:24Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2016-04-30T01:24:24Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=32223c1b7dea9bcf5ccb35a6462fb6a29a344910'/>
<id>urn:sha1:32223c1b7dea9bcf5ccb35a6462fb6a29a344910</id>
<content type='text'>
Mostly on comments.
</content>
</entry>
<entry>
<title>strfmon: reduce unnecessary snprintf.</title>
<updated>2014-07-12T15:19:30Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2014-07-12T15:19:30Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=0c029579787bd2fbb892c8bd254b57df5a28a3f5'/>
<id>urn:sha1:0c029579787bd2fbb892c8bd254b57df5a28a3f5</id>
<content type='text'>
No need for the snprintf/asprintf dance; use fixed width formats.

Obtained from:	NetBSD (CVS rev. 1.8)
MFC after:	1 week
</content>
</entry>
<entry>
<title>Implement xlocale APIs from Darwin, mainly for use by libc++.  This adds a</title>
<updated>2011-11-20T14:45:42Z</updated>
<author>
<name>David Chisnall</name>
<email>theraven@FreeBSD.org</email>
</author>
<published>2011-11-20T14:45:42Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=3c87aa1d3dc1d8dad3efad322852a8e1e76dee55'/>
<id>urn:sha1:3c87aa1d3dc1d8dad3efad322852a8e1e76dee55</id>
<content type='text'>
load of _l suffixed versions of various standard library functions that use
the global locale, making them take an explicit locale parameter.  Also
adds support for per-thread locales.  This work was funded by the FreeBSD
Foundation.

Please test any code you have that uses the C standard locale functions!

Reviewed by:    das (gdtoa changes)
Approved by:    dim (mentor)
</content>
</entry>
<entry>
<title>Fix PR</title>
<updated>2010-02-10T00:02:09Z</updated>
<author>
<name>Martin Cracauer</name>
<email>cracauer@FreeBSD.org</email>
</author>
<published>2010-02-10T00:02:09Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=3a921aa75da792ea26accc85f58b2266511861df'/>
<id>urn:sha1:3a921aa75da792ea26accc85f58b2266511861df</id>
<content type='text'>
http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/143350
Empty string test gone wrong.

Testing this requires that you have a locale that has the sign string
unset but has int_n_sign_posn set (the default locale falls through to
use "()" around negative numbers which is probably another bug).

I created that setup by hand and indeed without this fix negative
numbers are put out as positive numbers (doesn't fall through to use
"-" as default indicator).

Unfixed example in nl_NL.ISO8859-1 with lc-&gt;negative_sign set to empty
string:
  strfmon(buf, sizeof(buf), "%-8i", -42.0);
==&gt;
example2: 'EUR  42,00' 'Eu 42,00'

Fixed:
example2: 'EUR  42,00-' 'Eu 42,00-'

This file and suggested fix are identical in at least freebsd-8.
Backport might be appropriate but some expert on locales should
probably have a look at us defaulting to negative numbers in
parenthesis when LC_* is default.  That doesn't look right and is not
what other OSes are doing.

PR:		143350
Submitted by:	Corinna Vinschen
Reviewed by:	bug reporter submitted, tested by me
</content>
</entry>
<entry>
<title>Stricter check for integer overflow.</title>
<updated>2008-04-24T07:49:00Z</updated>
<author>
<name>Ruslan Ermilov</name>
<email>ru@FreeBSD.org</email>
</author>
<published>2008-04-24T07:49:00Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=eff93c8073fac6bbea85067fd1bd804982770c76'/>
<id>urn:sha1:eff93c8073fac6bbea85067fd1bd804982770c76</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Don't forget to free() currency_symbol and asciivalue when multiple</title>
<updated>2008-04-19T07:22:58Z</updated>
<author>
<name>Ruslan Ermilov</name>
<email>ru@FreeBSD.org</email>
</author>
<published>2008-04-19T07:22:58Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=5b30d6ca7796d82bf6bd40c559f29c86b07ba572'/>
<id>urn:sha1:5b30d6ca7796d82bf6bd40c559f29c86b07ba572</id>
<content type='text'>
conversion specifiers for them are present.

Submitted by:	Maxim Dounin &lt;mdounin@mdounin.ru&gt;
Obtained from:	NetBSD (partially)
MFC after:	3 days
</content>
</entry>
<entry>
<title>Better strfmon(3) conversion specifiers sanity checking.</title>
<updated>2008-04-19T07:18:22Z</updated>
<author>
<name>Ruslan Ermilov</name>
<email>ru@FreeBSD.org</email>
</author>
<published>2008-04-19T07:18:22Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=3890416f9c76b1736442d49b1f46e603eebee87b'/>
<id>urn:sha1:3890416f9c76b1736442d49b1f46e603eebee87b</id>
<content type='text'>
There were no checks for left and right precisions at all, and
a check for field width had integer overflow bug.

Reported by:	Maksymilian Arciemowicz
Security:	http://securityreason.com/achievement_securityalert/53
Submitted by:	Maxim Dounin &lt;mdounin@mdounin.ru&gt;
MFC after:	3 days
</content>
</entry>
</feed>
