<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/tests/od, branch v9.8</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=v9.8</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=v9.8'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2025-08-12T16:50:40Z</updated>
<entry>
<title>maint: use short form bug URLs</title>
<updated>2025-08-12T16:50:40Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2025-08-12T13:31:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=2543c0052c9be0e53c529f6be90b861ac99a092b'/>
<id>urn:sha1:2543c0052c9be0e53c529f6be90b861ac99a092b</id>
<content type='text'>
* cfg.mk (sc_prohibit-long-form-bug-urls): Disallow long form in code.
* scripts/git-hooks/commit-msg: Disallow long form in commit messages.
* NEWS: Shorten long urls.
* bootstrap.conf: Likewise.
* configure.ac: Likewise.
* scripts/git-hooks/commit-msg: Likewise.
* src/csplit.c: Likewise.
* src/fmt.c: Likewise.
* src/make-prime-list.c: Likewise.
* src/nohup.c: Likewise.
* tests/od/od-float.sh: Likewise.
* tests/rm/r-root.sh: Likewise.
* tests/tail/inotify-race.sh: Likewise.
* tests/tail/inotify-race2.sh: Likewise.
</content>
</entry>
<entry>
<title>tests: avoid false failure due to varied ERANGE errors</title>
<updated>2025-06-30T23:03:30Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2025-06-30T22:28:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=0512608a444507e6cc5444e62949962bc3d32d8d'/>
<id>urn:sha1:0512608a444507e6cc5444e62949962bc3d32d8d</id>
<content type='text'>
* tests/od/od.pl: Use the system error string for ERANGE,
rather than hardcoding a particular one.
Fixes https://bugs.gnu.org/78934
</content>
</entry>
<entry>
<title>od: add test cases for recent fix</title>
<updated>2025-06-30T05:32:05Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2025-06-30T05:31:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=5c5f069a4c8f33a0177acd021df2f4cad6860024'/>
<id>urn:sha1:5c5f069a4c8f33a0177acd021df2f4cad6860024</id>
<content type='text'>
* tests/od/od.pl: New tests for the offset issues
</content>
</entry>
<entry>
<title>od: fix '+N.' bug</title>
<updated>2025-06-29T04:00:41Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2025-06-29T00:29:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=66464e61f549e9f2fd35f82567345721798288f9'/>
<id>urn:sha1:66464e61f549e9f2fd35f82567345721798288f9</id>
<content type='text'>
* src/od.c (parse_old_offset): First arg is now char *,
not char const *.  If a decimal number, temporarily
modify the string so that xstrtoumax does not complain
about the '.'.
* tests/od/od.pl: Test for the bug.
</content>
</entry>
<entry>
<title>od: fix some unlikely integer overflows</title>
<updated>2025-06-29T04:00:41Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2025-06-26T06:22:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=88f30ee0a5c355701914d4446dc7ec729a344fa2'/>
<id>urn:sha1:88f30ee0a5c355701914d4446dc7ec729a344fa2</id>
<content type='text'>
* src/od.c (print_n_spaces, pad_at, pad_at_overflow):
New static functions.
(struct tspec, PRINT_FIELDS, print_named_ascii, print_ascii)
(decode_one_format, write_block, main):
Use idx_t, not int, for counts that depend on the number
of bytes in an object.
(decode_one_format): Use print_n_spaces to output spaces.
(PRINT_FIELDS, print_named_ascii, print_ascii):
Use pad_at to avoid integer overflow.
(write_block): Do not use %*s to pad, as the total pad might
exceed INT_MAX.  Instead, pad by hand with putchar (' ').
(main): Use pad_at_overflow to report integer overflow due to
oversize -w.  Use better way to tell whether -w is used,
without needing IF_LINT.
* tests/od/big-w.sh: New test.
* tests/local.mk (all_tests): Add it.
</content>
</entry>
<entry>
<title>od: output standard diagnostics for invalid -w arguments</title>
<updated>2025-06-24T15:37:01Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2025-06-24T14:47:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=2b7f3621f8b994db9436318fbe818a34ee87859a'/>
<id>urn:sha1:2b7f3621f8b994db9436318fbe818a34ee87859a</id>
<content type='text'>
* src/od.c (main): Don't pass LONGINT_OK to xstrtol_fatal(),
as otherwise it will abort().
* tests/od/od.pl: Add test cases.
* NEWS: Mention the bug fix.

Addresses https://bugs.gnu.org/78879
</content>
</entry>
<entry>
<title>od: fix various off-by-one issues with --strings with -N</title>
<updated>2025-06-24T15:21:00Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2025-06-24T00:17:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=44809c3379d64b9e580042124ccea6665d746d9a'/>
<id>urn:sha1:44809c3379d64b9e580042124ccea6665d746d9a</id>
<content type='text'>
* src/od.c (dump_strings): There are three related issues here
due to not accounting for the terminating NUL char appropriately.

1. Ensure BUF always has enough space for the terminating NUL.
This avoids CWE-122: Heap-based Buffer Overflow,
where we wrote a single NUL byte directly after the allocated buffer.
I.e., there should be no buffer overflow with:
  printf '%100s' | od -N100 -S1

2. Ensure we support -S == -N (END_OFFSET - STRING_MIN == ADDRESS):
I.e., there should be output with:
  printf '%100s' | od -N10 -S10

3. Ensure we always output a valid address by ensuring
the ADDRESS and I variables are kept in sync.
I.e., this should output address 0000000 not 1777777777777777777777:
  printf '%100s' | od -N10 -S1

As well as fixing these we simplify by using a single loop
to read the data, rather than two.

* doc/coreutils.texi (od invocation): Clarify that -N
implicitly NUL terminates strings.
* tests/od/od-N.sh: Add test cases.
* NEWS: Mention the bug fixes.

Fixes https://bugs.gnu.org/78880
</content>
</entry>
<entry>
<title>maint: update all copyright year number ranges</title>
<updated>2025-01-01T09:33:08Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2025-01-01T09:14:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=28b176085f04a6227d7fadd28a129b5cb02dfbf5'/>
<id>urn:sha1:28b176085f04a6227d7fadd28a129b5cb02dfbf5</id>
<content type='text'>
Update to latest gnulib with new copyright year.
Run "make update-copyright" and then...

* gnulib: Update included in this commit as copyright years
are the only change from the previous gnulib commit.
* 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>tests: od: avoid outputting undefined floating point values</title>
<updated>2024-03-27T12:41:33Z</updated>
<author>
<name>Bruno Haible</name>
<email>bruno@clisp.org</email>
</author>
<published>2024-03-27T12:30:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=bec53850b76f1240c566dfeb59db6ed6928bdf57'/>
<id>urn:sha1:bec53850b76f1240c566dfeb59db6ed6928bdf57</id>
<content type='text'>
od was seen to abort() on glibc on ia64 and m68k with the error:
Fatal glibc error: printf_fp.c:501 (__printf_fp_buffer_1):
assertion failed:
  cy == 1 || (p.frac[p.fracsize - 2] == 0 &amp;&amp; p.frac[0] == 0)

* tests/od/od-multiple-t.sh: Avoid outputting long double floats
to avoid undefined behavior. 'float' and 'double' are standardized
by IEEE 754 (except on Linux/m68k) and don't have undefined values.
</content>
</entry>
<entry>
<title>build: fix od build on clang &lt; 17</title>
<updated>2024-02-07T11:13:38Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2024-02-07T10:55:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=f85472082c5920951a2886c114612c5002899fb8'/>
<id>urn:sha1:f85472082c5920951a2886c114612c5002899fb8</id>
<content type='text'>
* configure.ac: Ensure the compiler can promote 16 bit floating point
types to float, before enabling that code in od.  This was an issue
with clang 16 at least.
* src/od.c: Adjust for the new defines.
* tests/od/od-float.sh: Likewise.  Also port to the dash shell,
whose inbuilt printf doesn't support hex escapes.
</content>
</entry>
</feed>
