lichray / nvi2

A multibyte fork of the nvi editor for BSD
Other
144 stars 34 forks source link

Fix segmentation fault in number increment #98

Closed ueXIMcWizBrdyVEciAlSwxP8aaXP70mO closed 3 years ago

ueXIMcWizBrdyVEciAlSwxP8aaXP70mO commented 3 years ago

Platform: NixOS 20.09 Kernel: Linux 5.4.111 (x86_64-linux, glibc 2.31)

This bug is identical in nature to #96---unscaled sprintf with wide characters. The commit also retroactively changes the fix in #96 to use the SIZE macro from common/multibyte.h.

My apologies about the piecemeal change requests. I am discovering these issues as I use the program. For completeness' sake, I checked the other instances of SPRINTF for the same bug, and it looks like the one fixed by this PR was the last remaining unscaled one.