You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 16, 2023. It is now read-only.
Description: Suppose your current directory contains a file with newline, such as $'hello\nworld.jpg'. A command such as find . -name "*.jpg" | sxiv -i will then fail, as sxiv interprets the above file as two separate inputs.
In the same manner, sxiv -o returns a newline-terminated list of files, which will cause problems for further processing in the above scenario. This is a very common trap with unix filenames, and can lead to serious security issues.
Suggestion: Tools like find and xargs include a -0 and -print0 option to return path lists as null terminated strings. My suggestion is to add a -0 option in sxiv with -i in order to accept a list of null-terminated pathnames, rather than newline-terminated. Similarly, add a -print0 option to return null-terminated output.
This will prevent breakage due to unusual filenames and make sxiv compatible with find, xargs etc.
Affected system: any linux system
Description: Suppose your current directory contains a file with newline, such as
$'hello\nworld.jpg'. A command such asfind . -name "*.jpg" | sxiv -iwill then fail, as sxiv interprets the above file as two separate inputs.In the same manner,
sxiv -oreturns a newline-terminated list of files, which will cause problems for further processing in the above scenario. This is a very common trap with unix filenames, and can lead to serious security issues.Suggestion: Tools like
findandxargsinclude a-0and-print0option to return path lists as null terminated strings. My suggestion is to add a-0option in sxiv with-iin order to accept a list of null-terminated pathnames, rather than newline-terminated. Similarly, add a-print0option to return null-terminated output.This will prevent breakage due to unusual filenames and make sxiv compatible with find, xargs etc.