Clarify sparse behaviour of truncate-size command.
[libguestfs.git] / daemon / strings.c
index 4701716..778aea3 100644 (file)
@@ -33,6 +33,12 @@ do_strings_e (const char *encoding, const char *path)
   char *out, *err;
   char **lines;
 
+  if (strlen (encoding) != 1 ||
+      strchr ("sSblBL", encoding[0]) == NULL) {
+    reply_with_error ("%s: invalid encoding", encoding);
+    return NULL;
+  }
+
   buf = sysroot_path (path);
   if (!buf) {
     reply_with_perror ("malloc");