<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/m4.git, branch branch-1.4</title>
<subtitle>git.savannah.gnu.org: git/m4.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/m4.git/'/>
<entry>
<title>output: Avoid tickling UBSAN with memcpy(dest, NULL, 0)</title>
<updated>2023-01-13T22:33:49+00:00</updated>
<author>
<name>Eric Blake</name>
<email>eblake@redhat.com</email>
</author>
<published>2023-01-13T22:27:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/m4.git/commit/?id=a886ea40a29a08954ff80772e267828a1d440cc9'/>
<id>a886ea40a29a08954ff80772e267828a1d440cc9</id>
<content type='text'>
Even though all libc handle it sanely (because size 0 says there is
nothing to copy), NULL is not a valid source pointer per a strict
reading of C, so UBSAN flags it:

+output.c:511:9: runtime error: null pointer passed as argument 2, which is declared to never be null

* src/output.c (make_room_for): Skip no-op memcpy.
Fixes: https://savannah.gnu.org/support/index.php?110809
Reported-by: Sam James
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Even though all libc handle it sanely (because size 0 says there is
nothing to copy), NULL is not a valid source pointer per a strict
reading of C, so UBSAN flags it:

+output.c:511:9: runtime error: null pointer passed as argument 2, which is declared to never be null

* src/output.c (make_room_for): Skip no-op memcpy.
Fixes: https://savannah.gnu.org/support/index.php?110809
Reported-by: Sam James
</pre>
</div>
</content>
</entry>
<entry>
<title>format: force C locale on floating point</title>
<updated>2023-01-13T21:41:14+00:00</updated>
<author>
<name>Eric Blake</name>
<email>eblake@redhat.com</email>
</author>
<published>2023-01-13T21:32:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/m4.git/commit/?id=dd434e3e958b3cebde954d66010919a40665812e'/>
<id>dd434e3e958b3cebde954d66010919a40665812e</id>
<content type='text'>
A minor release is not the time for format(`%.1f', `4.0') to complain
about 4.0 not being a number followed by outputting "4,0" in locales
where the decimal point is a comma.  Such a change belongs better in a
major release where more thought is put into locale-awareness across
the board.

* src/m4.c (main): Force LC_NUMERIC to c.
Reported-by: Bruno Haible in
https://lists.gnu.org/r/bug-m4/2021-06/msg00021.html
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A minor release is not the time for format(`%.1f', `4.0') to complain
about 4.0 not being a number followed by outputting "4,0" in locales
where the decimal point is a comma.  Such a change belongs better in a
major release where more thought is put into locale-awareness across
the board.

* src/m4.c (main): Force LC_NUMERIC to c.
Reported-by: Bruno Haible in
https://lists.gnu.org/r/bug-m4/2021-06/msg00021.html
</pre>
</div>
</content>
</entry>
<entry>
<title>maint: update to latest gnulib</title>
<updated>2023-01-13T21:11:44+00:00</updated>
<author>
<name>Eric Blake</name>
<email>eblake@redhat.com</email>
</author>
<published>2023-01-13T21:11:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/m4.git/commit/?id=3943e7355e4749ea53a8a5319a43926723c56a39'/>
<id>3943e7355e4749ea53a8a5319a43926723c56a39</id>
<content type='text'>
* gnulib: Update to latest.
* m4/gnulib-cache.m4: Copyright date is bumped as a result.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* gnulib: Update to latest.
* m4/gnulib-cache.m4: Copyright date is bumped as a result.
</pre>
</div>
</content>
</entry>
<entry>
<title>symtab: Fix memory corruption when tracing a popdef'd macro</title>
<updated>2023-01-13T21:02:26+00:00</updated>
<author>
<name>Eric Blake</name>
<email>eblake@redhat.com</email>
</author>
<published>2023-01-13T16:44:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/m4.git/commit/?id=b5b01fd1a420dc2679ebe7f1f2229d07ec85ae64'/>
<id>b5b01fd1a420dc2679ebe7f1f2229d07ec85ae64</id>
<content type='text'>
While debugging a script with 'm4 -daeqt', I was surprised to see
uninitialized memory in the trace for one of the macro invocations.
Rerunning it under valgrind confirmed a use-after-free.

* src/symtab.c (free_symbol): When popdef marks an in-expansion nested
definition unused, clone its name in case it is being traced.
(lookup_symbol) [SYMBOL_INSERT]: Consistently use SYMBOL_NAME(), and
share the name across a symbol stack instead of needing to clone.
* doc/m4.texi (Undefine): Test this.
* NEWS: Document the fix.

Fixes: ee427b83b5 ("symtab: use less memory in pushdef stacks")
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While debugging a script with 'm4 -daeqt', I was surprised to see
uninitialized memory in the trace for one of the macro invocations.
Rerunning it under valgrind confirmed a use-after-free.

* src/symtab.c (free_symbol): When popdef marks an in-expansion nested
definition unused, clone its name in case it is being traced.
(lookup_symbol) [SYMBOL_INSERT]: Consistently use SYMBOL_NAME(), and
share the name across a symbol stack instead of needing to clone.
* doc/m4.texi (Undefine): Test this.
* NEWS: Document the fix.

Fixes: ee427b83b5 ("symtab: use less memory in pushdef stacks")
</pre>
</div>
</content>
</entry>
<entry>
<title>build: Don't add _FORTIFY_SOURCE if already set by user/toolchain</title>
<updated>2023-01-13T19:48:49+00:00</updated>
<author>
<name>Sam James</name>
<email>sam@gentoo.org</email>
</author>
<published>2023-01-09T08:04:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/m4.git/commit/?id=dc03ee1303430c3d844e24a9185426948f144bdf'/>
<id>dc03ee1303430c3d844e24a9185426948f144bdf</id>
<content type='text'>
Newer toolchains (GCC 12+ or Clang 9+, glibc-2.34) allow _FORTIFY_SOURCE=3.

The current macro used in configure.ac will forcefully downgrade to F_S=2
and emit a warning if the user set something else:
```
x86_64-pc-linux-gnu-gcc -DEXEEXT=\"\" -I. -I../lib  -DIN_M4_GNULIB_TESTS=1 -I. -I. -I.. -I./.. -I../lib -I./../lib   -O2 -pipe -march=native -fdiagnostics-color=always -frecord-gcc-switches -Wreturn-type      -ggdb3 -Werror=implicit-function-declaration -Werror=implicit-int -c -o glthread/thread.o glthread/thread.c
In file included from glthread/thread.c:20:
../lib/config.h:202: warning: "_FORTIFY_SOURCE" redefined
  202 |    # define _FORTIFY_SOURCE 2
      |
&lt;built-in&gt;: note: this is the location of the previous definition
```

See: 390d259efe8e1c7e4b6babb4738fef7427416857
Signed-off-by: Sam James &lt;sam@gentoo.org&gt;
Message-Id: &lt;20230109080431.1320075-1-sam@gentoo.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Newer toolchains (GCC 12+ or Clang 9+, glibc-2.34) allow _FORTIFY_SOURCE=3.

The current macro used in configure.ac will forcefully downgrade to F_S=2
and emit a warning if the user set something else:
```
x86_64-pc-linux-gnu-gcc -DEXEEXT=\"\" -I. -I../lib  -DIN_M4_GNULIB_TESTS=1 -I. -I. -I.. -I./.. -I../lib -I./../lib   -O2 -pipe -march=native -fdiagnostics-color=always -frecord-gcc-switches -Wreturn-type      -ggdb3 -Werror=implicit-function-declaration -Werror=implicit-int -c -o glthread/thread.o glthread/thread.c
In file included from glthread/thread.c:20:
../lib/config.h:202: warning: "_FORTIFY_SOURCE" redefined
  202 |    # define _FORTIFY_SOURCE 2
      |
&lt;built-in&gt;: note: this is the location of the previous definition
```

See: 390d259efe8e1c7e4b6babb4738fef7427416857
Signed-off-by: Sam James &lt;sam@gentoo.org&gt;
Message-Id: &lt;20230109080431.1320075-1-sam@gentoo.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>maint: update bootstrap</title>
<updated>2023-01-13T19:47:32+00:00</updated>
<author>
<name>Eric Blake</name>
<email>eblake@redhat.com</email>
</author>
<published>2023-01-13T19:38:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/m4.git/commit/?id=70d69de70b063b20ffbeb52be0a20fa53477c89a'/>
<id>70d69de70b063b20ffbeb52be0a20fa53477c89a</id>
<content type='text'>
Done via:
  for f in gl/build-aux/*; do cp ~/bootstrap/build-aux/$(basename $f) $f; done
  gl/build-aux/inline-source gl/build-aux/bootstrap.in &gt; bootstrap

* gl/build-aux/*: Sync from upstream.
* bootstrap: Regenerate.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Done via:
  for f in gl/build-aux/*; do cp ~/bootstrap/build-aux/$(basename $f) $f; done
  gl/build-aux/inline-source gl/build-aux/bootstrap.in &gt; bootstrap

* gl/build-aux/*: Sync from upstream.
* bootstrap: Regenerate.
</pre>
</div>
</content>
</entry>
<entry>
<title>maint: bump copyright year</title>
<updated>2023-01-13T18:45:17+00:00</updated>
<author>
<name>Eric Blake</name>
<email>eblake@redhat.com</email>
</author>
<published>2023-01-13T18:45:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/m4.git/commit/?id=b325450200d46f0fee557f4d305b70135b3aed89'/>
<id>b325450200d46f0fee557f4d305b70135b3aed89</id>
<content type='text'>
Run 'make update-copyright' for 2023.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Run 'make update-copyright' for 2023.
</pre>
</div>
</content>
</entry>
<entry>
<title>maint: fix possible NULL dereference</title>
<updated>2022-01-26T18:28:48+00:00</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2022-01-26T18:27:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/m4.git/commit/?id=bb35e808e09f757fb67fbbc260401530dfb82d66'/>
<id>bb35e808e09f757fb67fbbc260401530dfb82d66</id>
<content type='text'>
Problem found by --enable-gcc-warnings.
* src/m4.h: Include intprops.h.
* src/output.c (m4_tmpname): Do not assume that xasprintf
returns non-null pointer.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem found by --enable-gcc-warnings.
* src/m4.h: Include intprops.h.
* src/output.c (m4_tmpname): Do not assume that xasprintf
returns non-null pointer.
</pre>
</div>
</content>
</entry>
<entry>
<title>maint: omit duplicate include</title>
<updated>2022-01-26T18:28:48+00:00</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2022-01-26T18:22:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/m4.git/commit/?id=4fab28a48436c39b9e9f613caefaf6af0a4b7fbb'/>
<id>4fab28a48436c39b9e9f613caefaf6af0a4b7fbb</id>
<content type='text'>
* src/format.c: Do not include xvasprintf.h,
as m4.h does that.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/format.c: Do not include xvasprintf.h,
as m4.h does that.
</pre>
</div>
</content>
</entry>
<entry>
<title>maint: pacify --enable-gcc-warnings</title>
<updated>2022-01-26T18:28:48+00:00</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2022-01-26T18:21:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/m4.git/commit/?id=476deb7f73ddd2a0b7653890448dbc10ea6aa6b9'/>
<id>476deb7f73ddd2a0b7653890448dbc10ea6aa6b9</id>
<content type='text'>
* src/symtab.c (lookup_symbol): Reword slightly,
to work around bug in GCC 11.2.0 when --enable-gcc-warnings.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/symtab.c (lookup_symbol): Reword slightly,
to work around bug in GCC 11.2.0 when --enable-gcc-warnings.
</pre>
</div>
</content>
</entry>
</feed>
