summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2022-04-12 22:26:16 +0200
committerSolomon Peachy <pizza@shaftnet.org>2022-08-04 14:40:59 -0400
commitf0a05e099337e88afe99ad0cad561caff96e48aa (patch)
treec715a1a24a371465ac35fdb61056e6d0686b8784
parent4101aeac54ded9591c52ac03a1b765afc394d6c0 (diff)
downloadrockbox-f0a05e099337e88afe99ad0cad561caff96e48aa.tar.gz
rockbox-f0a05e099337e88afe99ad0cad561caff96e48aa.zip
Properties plugin: Fix crash when parameter is zero-length string
This seems to be what is provided by the database when length of path+file name of an entry is larger than MAX_PATH. Change-Id: Iaf40ce945732a8a8c2e5270a80886dcb537a72be
-rw-r--r--apps/plugins/properties.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/plugins/properties.c b/apps/plugins/properties.c
index e5f00e307b..c4378a0356 100644
--- a/apps/plugins/properties.c
+++ b/apps/plugins/properties.c
@@ -313,7 +313,8 @@ enum plugin_status plugin_start(const void* parameter)
int button;
bool quit = false, usb = false;
const char *file = parameter;
- if(!parameter) return PLUGIN_ERROR;
+ if(!parameter || (file[0] != '/')) return PLUGIN_ERROR;
+
#ifdef HAVE_TOUCHSCREEN
rb->touchscreen_set_mode(rb->global_settings->touch_mode);
#endif