#include "exit-status.h"
#include "def.h"
#include "util.h"
+#include "utf8.h"
#ifdef HAVE_SYSV_COMPAT
}
/* Interpret STATUS= */
- if ((e = strv_find_prefix(tags, "STATUS="))) {
+ e = strv_find_prefix(tags, "STATUS=");
+ if (e) {
char *t;
if (e[7]) {
- if (!(t = strdup(e+7))) {
+
+ if (!utf8_is_valid(e+7)) {
+ log_warning("Status message in notification is not UTF-8 clean.");
+ return;
+ }
+
+ t = strdup(e+7);
+ if (!t) {
log_error("Failed to allocate string.");
return;
}