]> granicus.if.org Git - graphviz/commit
lexname: fix latent buffer overflow
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 24 Jul 2021 22:37:34 +0000 (15:37 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 28 Jul 2021 03:54:42 +0000 (20:54 -0700)
commitbf7770798e7a9a0fa6af57a133dd016521f8c654
treefe822b5ed368a02c59c27c1c41f42bf04d65e897
parent38d7df2ec9269faf6a36062c233b6f026d41cb2b
lexname: fix latent buffer overflow

Buffers of length MAXNAME are printed into, including in a case where the
printed string is "(EXTERNAL:%d)". This needs a maximum of 23 bytes, not 16
bytes as was previously used. This overflow looks impossible to actually trigger
because I believe this code path is only used in the case of a bug in the lexer
itself. Hence no changelog entry for this.

This issue was exposed when moving sfsprintf calls to snsprintf, as the compiler
understands the semantics of the latter and knows how to warn about detectable
overflows. Related to #1998.
lib/expr/exeval.c