]> git.eshelyaron.com Git - emacs.git/commit
Avoid undefined behavior in detect_coding routines
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 31 May 2022 08:19:32 +0000 (01:19 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 31 May 2022 08:26:47 +0000 (01:26 -0700)
commit82c05c034e1ecec49e4e8916b2cb6163d7a5bb74
tree8be231eb91fb2245f2f108f484fe2838f514564b
parent877be9098ee3ecc041216d39dbb20d0d044a46c0
Avoid undefined behavior in detect_coding routines

* src/coding.c (detect_coding): Always initialize all
components of detect_info, so that detect_coding_utf_8 etc.
do not have undefined behavior when they read detect_info.checked.
This bug is not likely to cause problems on real systems.
Problem found by GCC 12 -fanalyzer.
(detect_coding_system): Use consistent style with detect_coding
initialization.
src/coding.c