> const char editor[2];

If you get an editor string that is longer than 1 character (plus trailing 0 to 
terminate the string), do you know what’s getting clobbered? Something almost 
certainly is.

-DaveP

On Fri, Dec 19, 2025, at 07:30, Walter Alejandro Iglesias wrote:

> (src/usr.bin/ssh/sftp.c)
> -----------------------------------------
> const char editor[2];
>
>       if (!batchmode && isatty(STDIN_FILENO)) {
>
>               [...]
>
>               if (el_get(el, EL_EDITOR, editor) == '0')
>                       printf("Editor: %s\n", editor);
>
>               if (strncmp(editor, "vi", 2) == 0)
>                       el_set(el, EL_BIND, "^[", "vi-command-mode", NULL);
>       }
>
> ----------------------------------------------------------------------------
>
> Am I using el_get() in a wrong way?
>
>
> -- 
> Walter

Reply via email to