aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Brubaker <jbru362@gmail.com>2022-06-10 09:53:37 -0400
committerJeremy Brubaker <jbru362@gmail.com>2022-06-10 09:53:37 -0400
commitd1f098d11e58e86b57541a776cf001d4f11488e1 (patch)
treee5628801c82ef246bc7c274b8100440958e62950
parenta2adf4a6040a40c8adc09d8fbeae1a7e3f008615 (diff)
downloadanypinentry-d1f098d11e58e86b57541a776cf001d4f11488e1.tar.gz
anypinentry-d1f098d11e58e86b57541a776cf001d4f11488e1.zip
Ignore lines that are more than 1000 bytes
Per the Assuan spec
Diffstat (limited to '')
-rwxr-xr-xanypinentry5
1 files changed, 5 insertions, 0 deletions
diff --git a/anypinentry b/anypinentry
index 9412a3a..213fffe 100755
--- a/anypinentry
+++ b/anypinentry
@@ -143,6 +143,11 @@ END
}
interpret_command() {
+ # Refuse lines of more than 1000 bytes + newline
+ if [ $(echo "$1" | wc -c) -gt 1001 ]; then
+ echo "ERR too long"
+ return
+ fi
cmd="$(echo "$1" | cut -d' ' -f1 | tr a-z A-Z)";
data="$(echo "$1" | cut -d' ' -f2-)";