about summary refs log tree commit diff
path: root/editor
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2022-08-04 16:20:56 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2022-08-04 16:20:56 +0000
commitf8de4e03e9263e39d03455845ec2fc51fd99c6c7 (patch)
tree50d79817df3f6761b892a5457ad4f5db9b08f835 /editor
parent7657109a65938fa16b717662fafd2bdd12fb0b0d (diff)
downloadnetpbm-mirror-f8de4e03e9263e39d03455845ec2fc51fd99c6c7.tar.gz
netpbm-mirror-f8de4e03e9263e39d03455845ec2fc51fd99c6c7.tar.xz
netpbm-mirror-f8de4e03e9263e39d03455845ec2fc51fd99c6c7.zip
Validate size parameter is a number (to prevent shell injection problems)
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4393 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'editor')
-rwxr-xr-xeditor/pnmmargin7
1 files changed, 7 insertions, 0 deletions
diff --git a/editor/pnmmargin b/editor/pnmmargin
index 6b30c074..cfc5256e 100755
--- a/editor/pnmmargin
+++ b/editor/pnmmargin
@@ -67,6 +67,13 @@ fi
 size="$1"
 shift
 
+case $size in
+    ''|*[!0-9]*)
+        echo "Size argument '$size' is not a whole number"
+        exit 1
+        ;;
+esac
+
 if [ ${2-""} ] ; then
     echo "usage: $0 [-white|-black|-color <colorspec>] <size> [pnmfile]" 1>&2
     exit 1