]> git.ipfire.org Git - thirdparty/lldpd.git/commit
client/lldpcli: guard argc>0 before indexing argv
authorVincent Bernat <vincent@bernat.ch>
Sat, 9 May 2026 12:56:05 +0000 (14:56 +0200)
committerVincent Bernat <vincent@bernat.ch>
Sat, 9 May 2026 13:26:12 +0000 (15:26 +0200)
commit6fcc94a5c6aaa85dfda8ddd62baaf2abe219f1fb
tree6a3e4e30c06569e6a1f173eb45dcf64b2406c47e
parentee7c2bec7edbfb322a2f1f2b8ae0688be8a1608e
client/lldpcli: guard argc>0 before indexing argv

When the input is comment-only (e.g. "# foo"), tokenize_line() returns
zero tokens; `argv[argc - 1]` then reads `argv[-1]`. Guard the access.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
src/client/lldpcli.c