diff options
| author | login (envs.net) <login@envs.net> | 2020-02-21 17:16:36 +0000 |
|---|---|---|
| committer | login (envs.net) <login@envs.net> | 2020-02-21 17:16:36 +0000 |
| commit | c6270c739d48af98725cb5b92d2e5fb5f91b07a2 (patch) | |
| tree | 573c04a438db729955a05501f2b48c09eae1a926 | |
| parent | 3aa292ba349428f9672a158453f004bca72e6589 (diff) | |
| download | tcoin-c6270c739d48af98725cb5b92d2e5fb5f91b07a2.tar.gz | |
Replacing newlines and vertical tabs in messages with <new-line> and <vertical-tab>
Newlines and vertical tabs in messages are replaced with <new-line> and <vertical-tab> to prevent transaction spoofing inside a message.
| -rwxr-xr-x | ntcoin | 4 | ||||
| -rw-r--r-- | pcoin.cpp | 4 | ||||
| -rw-r--r-- | tcoin.cpp | 4 |
3 files changed, 8 insertions, 4 deletions
@@ -192,7 +192,7 @@ else && (/bin/cp "'`/usr/bin/realpath -s $1`'/tcoin/bin/tcoin" "'`/usr/bin/realpath -s $2`'/tcoin") \ && (/bin/chmod 550 "'`/usr/bin/realpath -s $2`'/tcoin") \ && (/bin/chmod u+s "'`/usr/bin/realpath -s $2`'/tcoin") \ -&& (/bin/cp "'`/usr/bin/realpath -s $1`'/tcoin/bin/tcoin_defs.cpp'" "'`/usr/bin/realpath -s $2`'/tcoin_defs.cpp'")' > "`/usr/bin/realpath -s $1`/tcoin/bin/compile_tcoin" +&& (/bin/cp "'`/usr/bin/realpath -s $1`'/tcoin/bin/tcoin_defs.cpp" "'`/usr/bin/realpath -s $2`'/tcoin_defs.cpp")' > "`/usr/bin/realpath -s $1`/tcoin/bin/compile_tcoin" /bin/chmod 540 "`/usr/bin/realpath -s $1`/tcoin/bin/compile_tcoin" /bin/echo '#!/bin/bash '`which nano`' "'`/bin/pwd`'/tcoin.cpp"' > "`/usr/bin/realpath -s $1`/tcoin/bin/edit_tcoin" @@ -214,7 +214,7 @@ else && (/bin/cp "'`/usr/bin/realpath -s $1`'/tcoin/bin/pcoin" "'`/usr/bin/realpath -s $2`'/pcoin") \ && (/bin/chmod 550 "'`/usr/bin/realpath -s $2`'/pcoin") \ && (/bin/chmod u+s "'`/usr/bin/realpath -s $2`'/pcoin") \ -&& (/bin/cp "'`/usr/bin/realpath -s $1`'/tcoin/bin/pcoin_defs.cpp'" "'`/usr/bin/realpath -s $2`'/pcoin_defs.cpp'")' > "`/usr/bin/realpath -s $1`/tcoin/bin/compile_pcoin" +&& (/bin/cp "'`/usr/bin/realpath -s $1`'/tcoin/bin/pcoin_defs.cpp" "'`/usr/bin/realpath -s $2`'/pcoin_defs.cpp")' > "`/usr/bin/realpath -s $1`/tcoin/bin/compile_pcoin" /bin/chmod 540 "`/usr/bin/realpath -s $1`/tcoin/bin/compile_pcoin" /bin/echo '#!/bin/bash '`which nano`' "'`/bin/pwd`'/pcoin.cpp"' > "`/usr/bin/realpath -s $1`/tcoin/bin/edit_pcoin" @@ -678,7 +678,9 @@ int send_message(const char* sender_username, const char* receiver_username, con for(int i=0; message[i]!='\0'; ++i) { if(message[i] == '\n') - fout << "\u23CE "; //return-key symbol, or return symbol, or enter symbol; space for spacing + fout << "<new-line>"; //return-key pressed + else if(message[i] == '\v') + fout << "<vertical-tab>"; //vertical-tab symbol entered else fout << message[i]; } @@ -961,7 +961,9 @@ int send_message(const char* sender_username, const char* receiver_username, con for(int i=0; message[i]!='\0'; ++i) { if(message[i] == '\n') - fout << "\u23CE "; //return-key symbol, or return symbol, or enter symbol; space for spacing + fout << "<new-line>"; //return-key pressed + else if(message[i] == '\v') + fout << "<vertical-tab>"; //vertical-tab symbol entered else fout << message[i]; } |