Fix context range check

This commit is contained in:
Arun Prakash Jana 2020-05-05 17:14:42 +05:30
parent a950510342
commit 6ee257920d
No known key found for this signature in database
GPG key ID: A75979F35C080412
2 changed files with 2 additions and 2 deletions

View file

@ -188,7 +188,7 @@ Usage examples can be found in the Examples section below.
#### Get notified on file hover #### Get notified on file hover
If `NNN_FIFO` is set, `nnn` will open it and write every hovered files. This can be used in plugins, e.g. to implement file previews. If `NNN_FIFO` is set, `nnn` will open it and write every hovered files. This can be used in plugins and external scripts, e.g. to implement file previews.
If a `NNN_FIFO` is set globally, each `nnn` instance will write to it, and a process reading from the pipe will get hovered path from every instance, interleaved. If a `NNN_FIFO` is set globally, each `nnn` instance will write to it, and a process reading from the pipe will get hovered path from every instance, interleaved.

View file

@ -4258,7 +4258,7 @@ static void readpipe(int fd, char **path, char **lastname, char **lastdir)
ctx = r + 1; ctx = r + 1;
} else { } else {
ctx = g_buf[0] - '0'; ctx = g_buf[0] - '0';
if (ctx > CTX_MAX) if (ctx < 0 || ctx > CTX_MAX)
return; return;
} }