* Fix format-truncation warning, missing string.h inclusion and strnlen warning
* Dynamic string width field
// asn.1 dumping
//-----------------------------------------------------------------------------
+#define _POSIX_C_SOURCE 200809L // need for strnlen()
+
#include "asn1dump.h"
#include <ctype.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
+#include <string.h>
#include <jansson.h>
#include <mbedtls/asn1.h>
#include <mbedtls/oid.h>
}
PrintAndLog(buffer2);
} else {
- snprintf(buffer2, sizeof(buffer2), "%s%s", prefix, buffer);
+ snprintf(buffer2, sizeof(buffer2), "%s%.*s", prefix, MAX_PRINT_BUFFER - 20, buffer);
PrintAndLog(buffer2);
}
}