diff options
author | Richard Jones <rjones@redhat.com> | 2010-05-12 16:55:59 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2010-05-13 16:22:10 +0100 |
commit | 287f8957fea3efe411c7ac55595d5d6c7b613e4e (patch) | |
tree | ea138c96bde1fa5f05586ac17868d4a247ac584a /daemon | |
parent | 1c6ed48bd3cd471dc6e4613ede9151631e19f55a (diff) | |
download | libguestfs-287f8957fea3efe411c7ac55595d5d6c7b613e4e.tar.gz libguestfs-287f8957fea3efe411c7ac55595d5d6c7b613e4e.tar.xz libguestfs-287f8957fea3efe411c7ac55595d5d6c7b613e4e.zip |
Fix error message in string-e command (RHBZ#588651).
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/strings.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/daemon/strings.c b/daemon/strings.c index 1ba02419..f08401b2 100644 --- a/daemon/strings.c +++ b/daemon/strings.c @@ -34,6 +34,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; + } + CHROOT_IN; fd = open (path, O_RDONLY); CHROOT_OUT; |