diff --git a/userspace/engine/banned.h b/userspace/engine/banned.h index 21dfdb2c..41690220 100644 --- a/userspace/engine/banned.h +++ b/userspace/engine/banned.h @@ -23,3 +23,24 @@ limitations under the License. #undef strcpy #define strcpy(a, b) BAN(strcpy) + +#undef vsprintf +#define vsprintf(a, b, c) BAN(vsprintf) + +#undef sprintf +#define sprintf(a, b, ...) BAN(sprintf) + +#undef strcat +#define strcat(a, b) BAN(strcat) + +#undef strncat +#define strncat(a, b, c) BAN(strncat) + +#undef strncpy +#define strncpy(a, b, c) BAN(strncpy) + +#undef swprintf +#define swprintf(a, b, c, ...) BAN(swprintf) + +#undef vswprintf +#define vswprintf(a, b, c, d) BAN(vswprintf) diff --git a/userspace/falco/logger.cpp b/userspace/falco/logger.cpp index da4d6cf3..cf023a9b 100644 --- a/userspace/falco/logger.cpp +++ b/userspace/falco/logger.cpp @@ -131,12 +131,8 @@ void falco_logger::log(int priority, const string msg) { char buf[sizeof "YYYY-MM-DDTHH:MM:SS-0000"]; struct tm *gtm = std::gmtime(&result); - if(gtm == NULL || - (strftime(buf, sizeof(buf), "%FT%T%z", gtm) == 0)) - { - sprintf(buf, "N/A"); - } - else + if(gtm != NULL && + (strftime(buf, sizeof(buf), "%FT%T%z", gtm) != 0)) { fprintf(stderr, "%s: %s", buf, msg.c_str()); }