From 8bac25377cf2c447c439c04837ea178d6a0f845c Mon Sep 17 00:00:00 2001 From: Nicholas Vinson Date: Mon, 12 Apr 2021 20:51:38 -0400 Subject: 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 --- wgetpaste | 4 ++-- 1 file 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|' -- cgit v1.2.3