镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Fix missing getopt_long option array terminators - #235

Open
vitlav wants to merge 1 commit into
libts:masterfrom
vitlav:fix-getopt-long-option-terminators
Open

vitlav wants to merge 1 commit into
libts:masterfrom
vitlav:fix-getopt-long-option-terminators

Conversation

@vitlav

@vitlav vitlav commented Oct 26, 2026

Copy link
Copy Markdown

The command line tools and test programs define struct option arrays without the required all-zero terminator. On glibc, passing an unrecognized long option can read beyond the array and crash instead of reporting a usage error.

Add { NULL, 0, NULL, 0 } to each affected array in the test programs and ts_uinput. This follows the getopt_long(3) contract and lets invalid options be handled normally.

Tested with tslib 1.24 in ALT Linux: an unknown long option now prints the usage message instead of crashing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant