Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 1111fb24 authored by Rob Swindell's avatar Rob Swindell 💬

Allow SAFECAT to work on uchar arrays

Caught by CID 331001

The use of SAFECAT() with a typecast to a pointer is not going to work as expected. This change broke line-based telnet-gateway functionality (unconfirmed, but pretty obvious).
parent a1f9abb7
Pipeline #1851 failed with stage
in 9 minutes and 11 seconds
......@@ -191,7 +191,7 @@ void sbbs_t::telnet_gate(char* destaddr, ulong mode, char* client_user_name, cha
rd=getstr((char*)buf,sizeof(buf)-1,l);
if(!rd)
continue;
SAFECAT((char*)buf,crlf);
SAFECAT(buf,crlf);
rd+=2;
gotline=true;
}
......
......@@ -427,8 +427,8 @@ typedef struct {
#endif
#define SAFECAT(dst, src) do { \
if(strlen(dst) + strlen(src) < sizeof(dst)) { \
strcat(dst, src); \
if(strlen((char*)(dst)) + strlen((char*)(src)) < sizeof(dst)) { \
strcat((char*)(dst), (char*)(src)); \
} \
} while(0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment