All of lore.kernel.org
 help / color / mirror / Atom feed
* Out-of-bounds access in alias command
@ 2023-01-09  0:02 Harald van Dijk
  2023-01-22 15:09 ` Harald van Dijk
  0 siblings, 1 reply; 3+ messages in thread
From: Harald van Dijk @ 2023-01-09  0:02 UTC (permalink / raw)
  To: DASH shell mailing list

Hi,

Consider

   alias ""

In aliascmd(), we have

     while ((n = *++argv) != NULL) {
       if ((v = strchr(n+1, '=')) == NULL) { /* n+1: funny ksh stuff */

When *n == '\0', the strchr(n+1, '=') searches past the end of the string.

I have not yet been able to construct a test case where this causes 
problems, because my attempts have resulted in the memory following this 
empty string not containing any = before another null byte appears.

Cheers,
Harald van Dijk

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-08  4:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-09  0:02 Out-of-bounds access in alias command Harald van Dijk
2023-01-22 15:09 ` Harald van Dijk
2024-04-08  4:55   ` [PATCH] alias: Fix out-of-bound access Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.