From 37dd46e92f776c1bc4ee83fdcaceb8d5e15fb5c8 Mon Sep 17 00:00:00 2001 From: Teruaki Kawashima Date: Wed, 29 Jul 2009 13:56:23 +0000 Subject: [PATCH] Check if parameter is NULL in plugins which only works as viewer. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22083 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/iriverify.c | 1 + apps/plugins/properties.c | 1 + apps/plugins/search.c | 1 + apps/plugins/sort.c | 1 + 4 files changed, 4 insertions(+) diff --git a/apps/plugins/iriverify.c b/apps/plugins/iriverify.c index 35a96a05c4..eaaec4b1e1 100644 --- a/apps/plugins/iriverify.c +++ b/apps/plugins/iriverify.c @@ -135,6 +135,7 @@ enum plugin_status plugin_start(const void* parameter) char *buf; int rc; int i; + if(!parameter) return PLUGIN_ERROR; filename = (char *)parameter; buf = rb->plugin_get_audio_buffer((size_t *)&buf_size); /* start munching memory */ diff --git a/apps/plugins/properties.c b/apps/plugins/properties.c index b57150b817..c76a25b06a 100644 --- a/apps/plugins/properties.c +++ b/apps/plugins/properties.c @@ -275,6 +275,7 @@ enum plugin_status plugin_start(const void* parameter) int button; bool quit = false; char file[MAX_PATH]; + if(!parameter) return PLUGIN_ERROR; rb->strcpy(file, (const char *) parameter); /* determine if it's a file or a directory */ diff --git a/apps/plugins/search.c b/apps/plugins/search.c index 4c6d569806..e9732d219b 100644 --- a/apps/plugins/search.c +++ b/apps/plugins/search.c @@ -149,6 +149,7 @@ enum plugin_status plugin_start(const void* parameter) int ok; const char *filename = parameter; char *p; + if(!parameter) return PLUGIN_ERROR; DEBUGF("%s - %s\n", (char *)parameter, &filename[rb->strlen(filename)-4]); /* Check the extension. We only allow .m3u files. */ diff --git a/apps/plugins/sort.c b/apps/plugins/sort.c index 24be560398..1877831815 100644 --- a/apps/plugins/sort.c +++ b/apps/plugins/sort.c @@ -180,6 +180,7 @@ enum plugin_status plugin_start(const void* parameter) { char *buf; int rc; + if(!parameter) return PLUGIN_ERROR; filename = (char *)parameter;