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

Commits (1)
  • Rob Swindell's avatar
    Don't append the stale static string in fmsgattr_str() · bb0d2496
    Rob Swindell authored
    When this function was called multiple times (e.g. multiple messages in a pkt),
    it would keep appending to the current (static) string, eventually overflowing
    the buffer and corrupting the stack. Although reported in pktdump, it could
    have also happened with fmsgdump if passed multiple stored message (.msg) files.
    
    Fixes #295 reported by Nelgin
    bb0d2496
......@@ -32,6 +32,7 @@ const char* fmsgattr_str(uint16_t attr)
{
char str[64] = "";
str[0] = '\0';
#define FIDO_ATTR_CHECK(a, f) if(a&FIDO_##f) sprintf(str + strlen(str), "%s%s", str[0] == 0 ? "" : ", ", #f);
FIDO_ATTR_CHECK(attr, PRIVATE);
FIDO_ATTR_CHECK(attr, CRASH);
......
......@@ -52,6 +52,7 @@ const char* fmsgattr_str(uint16_t attr)
{
static char str[64] = "";
str[0] = '\0';
#define FIDO_ATTR_CHECK(a, f) if(a&FIDO_##f) sprintf(str + strlen(str), "%s%s", str[0] == 0 ? "" : ", ", #f);
FIDO_ATTR_CHECK(attr, PRIVATE);
FIDO_ATTR_CHECK(attr, CRASH);
......