<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/src/basenc.c, branch v9.0</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=v9.0</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=v9.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2021-08-30T04:06:32Z</updated>
<entry>
<title>basenc: fix bug49741: using wrong decoding buffer length</title>
<updated>2021-08-30T04:06:32Z</updated>
<author>
<name>Assaf Gordon</name>
<email>assafgordon@gmail.com</email>
</author>
<published>2021-08-16T21:03:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=709d1f8253072804cc27189a6f2b873d8d563399'/>
<id>urn:sha1:709d1f8253072804cc27189a6f2b873d8d563399</id>
<content type='text'>
Emil Lundberg &lt;lundberg.emil@gmail.com&gt; reports in
https://bugs.gnu.org/49741 about a 'basenc --base64 -d' decoding bug.
The input buffer length was not divisible by 3, resulting in
decoding errors.

* NEWS: Mention fix.
* src/basenc.c (DEC_BLOCKSIZE): Change from 1024*5 to 4200 (35*3*5*8)
which is divisible by 3,4,5,8 - satisfying both base32 and base64;
Use compile-time verify() macro to enforce the above.
* tests/misc/basenc.pl: Add test.
</content>
</entry>
<entry>
<title>basenc: prefer signed to unsigned integers</title>
<updated>2021-08-28T00:12:27Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2021-08-27T22:29:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=97d8dcc5ca433471eac0609c0e8d51d40082876f'/>
<id>urn:sha1:97d8dcc5ca433471eac0609c0e8d51d40082876f</id>
<content type='text'>
This patch modifies basenc to prefer signed integers to
unsigned, as signed are less error-prone.
This patch also updates Gnulib to to latest, which updates Gnulib’s
base32 and base64 modules to prefer signed to unsigned integers.
* src/basenc.c: Include idx.h.
(struct base2_decode_context): Use unsigned char, not unsigned
for an octet that must fit in an unsigned char.
(base_encode, struct base_decode_context)
(base64_decode_ctx_wrapper, prepare_inbuf, base64url_encode)
(base64url_decode_ctx_wrapper, base32_decode_ctx_wrapper)
(base32hex_encode, base32hex_decode_ctx_wrapper, base16_encode)
(base16_decode_ctx, z85_encode, Z85_HI_CTX_TO_32BIT_VAL)
(z85_decoding, z85_decode_ctx, base2msbf_encode)
(base2lsbf_encode, base2lsbf_decode_ctx, base2msbf_decode_ctx)
(wrap_write, do_encode, do_decode, main):
Prefer signed integers to unsigned.
(main): Treat extremely large wrap columns as if they were
infinite; that’s good enough.  Since we’re now using xstrtoimax,
this allows ‘-w -0’ (same as ‘-w 0’).
* tests/misc/base64.pl (gen_tests): -w-0 is no longer an error.
</content>
</entry>
<entry>
<title>maint: while (1) → while (true)</title>
<updated>2021-06-27T01:40:26Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2021-06-27T01:23:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=53bb0235d5fdcf6b5e0243b53b1713eb2f5474bc'/>
<id>urn:sha1:53bb0235d5fdcf6b5e0243b53b1713eb2f5474bc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>maint: use "char const *" rather than "const char *"</title>
<updated>2021-04-11T17:33:45Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2021-04-11T17:23:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=ef772bf97f7ec577754cbb5b278504d83cf41a43'/>
<id>urn:sha1:ef772bf97f7ec577754cbb5b278504d83cf41a43</id>
<content type='text'>
* cfg.mk (sc_prohibit-const-char): Add a new syntax-check to
enforce this style.
* *.[ch]: sed -i 's/const char \*/char const */g'
</content>
</entry>
<entry>
<title>maint: update all copyright year number ranges</title>
<updated>2021-01-01T16:36:09Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2021-01-01T16:36:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=32ff1d1313ff566685b9092ac929251a4c22e7c4'/>
<id>urn:sha1:32ff1d1313ff566685b9092ac929251a4c22e7c4</id>
<content type='text'>
Run "make update-copyright" and then...

* gnulib: Update to latest with copyright year adjusted.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Likewise.
* tests/sample-test: Adjust to use the single most recent year.
</content>
</entry>
<entry>
<title>doc: make blank lines before --help consistent</title>
<updated>2020-10-27T19:23:46Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2020-10-27T14:10:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=51cfaef6557a4ff72a8900014185d9299979f7ea'/>
<id>urn:sha1:51cfaef6557a4ff72a8900014185d9299979f7ea</id>
<content type='text'>
* src/basenc.c (usage): Remove extraneous blank line,
to be consistent with other utilities that have options.
* src/realpath.c: Likewise.
* src/runcon.c: Likewise.
Addresses https://bugs.gnu.org/44248
</content>
</entry>
<entry>
<title>basenc: avoid undefined behaviour in z85 processing</title>
<updated>2020-03-04T12:38:27Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2020-03-04T12:24:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=0ea65e29dc346e9fe39db663b2ed43d7981ed266'/>
<id>urn:sha1:0ea65e29dc346e9fe39db663b2ed43d7981ed266</id>
<content type='text'>
* src/basenc.c (z85_decode_ctx_init): Ensure we're working
with unsigned, as otherwise ubsan triggers with:
  src/basenc.c:767:18: runtime error: signed integer overflow:
  43 * 52200625 cannot be represented in type 'int'
(z85_encode): Likewise to avoid the usban error:
  src/basenc.c:630:26: runtime error:
  left shift of 134 by 24 places cannot be represented in type 'int'
</content>
</entry>
<entry>
<title>maint: update all copyright year number ranges</title>
<updated>2020-01-01T14:16:56Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2020-01-01T14:16:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=aaba82431ceca97441d56152d8c7ec2d84fa1d12'/>
<id>urn:sha1:aaba82431ceca97441d56152d8c7ec2d84fa1d12</id>
<content type='text'>
Run "make update-copyright" and then...

* gnulib: Update to latest with copyright year adjusted.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Likewise.
* tests/sample-test: Adjust to use the single most recent year.
</content>
</entry>
<entry>
<title>basenc: port to C99</title>
<updated>2019-05-11T20:55:54Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2019-05-11T20:01:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=2fd0be3621027d67b83c7427c1b629bb5e18906e'/>
<id>urn:sha1:2fd0be3621027d67b83c7427c1b629bb5e18906e</id>
<content type='text'>
* src/basenc.c: Various minor style cleanups.
(struct base_decode_context): Do not use anonymous unions, as
they’re not in C99.  Use a named union instead.  All uses changed.
</content>
</entry>
<entry>
<title>basenc: allocate buffers on heap</title>
<updated>2019-01-06T00:14:07Z</updated>
<author>
<name>Assaf Gordon</name>
<email>assafgordon@gmail.com</email>
</author>
<published>2019-01-05T23:22:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=d045ce5166c06829ee5a63a33e120fe5ee5b83d4'/>
<id>urn:sha1:d045ce5166c06829ee5a63a33e120fe5ee5b83d4</id>
<content type='text'>
Allocate the encoding/decoding buffers dynamically on the heap instead
of using variable-length-array (VLA) on the stack.
Discussed in https://lists.gnu.org/r/coreutils/2019-01/msg00004.html .

* src/basenc.c (do_encode,do_decode): Allocate inbuf/outbuf using
xmalloc, and free if using LINT.
</content>
</entry>
</feed>
