summaryrefslogtreecommitdiffstats
path: root/src/image/script.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/image/script.c')
-rw-r--r--src/image/script.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/image/script.c b/src/image/script.c
index 161ac682..fb89e422 100644
--- a/src/image/script.c
+++ b/src/image/script.c
@@ -221,11 +221,17 @@ static const char *goto_label;
* @ret rc Return status code
*/
static int goto_find_label ( const char *line ) {
+ size_t len = strlen ( goto_label );
if ( line[0] != ':' )
return -ENOENT;
- if ( strcmp ( goto_label, &line[1] ) != 0 )
+
+ if ( strncmp ( goto_label, &line[1], len ) != 0 )
+ return -ENOENT;
+
+ if ( line[ 1 + len ] && ! isspace ( line[ 1 + len ] ) )
return -ENOENT;
+
return 0;
}