input: Fix potential out-of-bounds read in popstring
commit32fdc38848381389450aa736a82f7285ed61fc68
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 2 May 2024 10:22:20 +0000 (2 18:22 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 12 May 2024 04:07:29 +0000 (12 12:07 +0800)
treef55e36712aed103411636bb645d4fc3786843ee1
parent1f1e555aba99808a82cb5090b5ef980714dea09c
input: Fix potential out-of-bounds read in popstring

For an empty alias, the check on the last character of the alias in
popstring may read a bogus byte.  Fix this by checking whether the
alias is empty or not before reading the last byte.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
src/input.c