]> git.sur5r.net Git - openocd/blobdiff - src/target/image.c
gdb_server: fix memory leaks in users of get_reg_features_list()
[openocd] / src / target / image.c
index f47ba2274b822a93f4a30113152ee2587ec8788b..07420b1f5adfc34fe471eaaac9f7c158a12ce765 100644 (file)
@@ -152,6 +152,9 @@ static int image_ihex_buffer_complete_inner(struct image *image,
                uint8_t cal_checksum = 0;
                size_t bytes_read = 0;
 
+               if (lpszLine[0] == '#')
+                       continue;
+
                if (sscanf(&lpszLine[bytes_read], ":%2" SCNx32 "%4" SCNx32 "%2" SCNx32, &count,
                        &address, &record_type) != 3)
                        return ERROR_IMAGE_FORMAT_ERROR;
@@ -899,7 +902,7 @@ int image_read_section(struct image *image,
        return ERROR_OK;
 }
 
-int image_add_section(struct image *image, uint32_t base, uint32_t size, int flags, uint8_t *data)
+int image_add_section(struct image *image, uint32_t base, uint32_t size, int flags, uint8_t const *data)
 {
        struct imagesection *section;