]> git.sur5r.net Git - openocd/commitdiff
Improve handle_verify_image_command_internal command argument handling:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Sat, 13 Jun 2009 00:33:55 +0000 (00:33 +0000)
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Sat, 13 Jun 2009 00:33:55 +0000 (00:33 +0000)
- Use parse_u32 to ensure address parses properly.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2234 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/target/target.c

index ded4d55d7e21001f93068271a4dc28a2cb4f87f8..5a7ac3bc7e613a8a13960c52b1247fab8bcfcb28 100644 (file)
@@ -2366,8 +2366,12 @@ static int handle_verify_image_command_internal(struct command_context_s *cmd_ct
 
        if (argc >= 2)
        {
+               u32 addr;
+               retval = parse_u32(args[1], &addr);
+               if (ERROR_OK != retval)
+                       return ERROR_COMMAND_SYNTAX_ERROR;
+               image.base_address = addr;
                image.base_address_set = 1;
-               image.base_address = strtoul(args[1], NULL, 0);
        }
        else
        {