summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Vinson <nvinson234@gmail.com>2021-04-12 20:51:38 -0400
committerRasmus Thomsen <oss@cogitri.dev>2021-04-22 10:43:01 +0200
commit8bac25377cf2c447c439c04837ea178d6a0f845c (patch)
treed25238891a000a6978c8d77b304c6e48038a12c4
parentb65dedd7b2280e8971a3b00b60464bd18ebbb4b2 (diff)
downloadwgetpaste-8bac25377cf2c447c439c04837ea178d6a0f845c.tar.gz
Do not interpret content when posting to dpaste
'echo -e' is used to prepare data for dpaste. However if `echo -e "${content}"` is used, the content gets interpreted as well. This results in constructs such as '\0' getting misinterpreted as the byte 0x00. As a result, the interperted context can result in output not compatible with dpaste. fixes bug #25
-rwxr-xr-xwgetpaste4
1 files changed, 2 insertions, 2 deletions
diff --git a/wgetpaste b/wgetpaste
index 1f4db57..33e91f9 100755
--- a/wgetpaste
+++ b/wgetpaste
@@ -133,8 +133,8 @@ POST_dpaste() {
echo -e "--$boundary\r"
echo -e "Content-Disposition: form-data; name=\"content\"\r"
echo -e "\r"
- echo -e "${content}\r"
- echo -e "--${boundary}--\r"
+ echo -n "${content}"
+ echo -e "\r\n--${boundary}--\r"
ADDITIONAL_HEADERS_dpaste=("Content-Type: multipart/form-data; boundary=${boundary}")
}
REGEX_RAW_dpaste='s|^http.*|\0.txt|'