aboutsummaryrefslogtreecommitdiffstats
path: root/src/OtherCommands.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/OtherCommands.cxx')
-rw-r--r--src/OtherCommands.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/OtherCommands.cxx b/src/OtherCommands.cxx
index 07fbc8442..7f592ee9f 100644
--- a/src/OtherCommands.cxx
+++ b/src/OtherCommands.cxx
@@ -34,6 +34,7 @@
#include "ls.hxx"
#include "Volume.hxx"
#include "util/UriUtil.hxx"
+#include "fs/Path.hxx"
extern "C" {
#include "stats.h"
@@ -117,9 +118,16 @@ handle_lsinfo(Client *client, int argc, char *argv[])
if (strncmp(uri, "file:///", 8) == 0) {
/* print information about an arbitrary local file */
const char *path_utf8 = uri + 7;
+ const Path path_fs = Path::FromUTF8(path_utf8);
+
+ if (path_fs.IsNull()) {
+ command_error(client, ACK_ERROR_NO_EXIST,
+ "unsupported file name");
+ return COMMAND_RETURN_ERROR;
+ }
GError *error = NULL;
- if (!client_allow_file(client, path_utf8, &error))
+ if (!client_allow_file(client, path_fs, &error))
return print_error(client, error);
struct song *song = song_file_load(path_utf8, NULL);