summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2007-03-15 23:55:26 +0000
committerDave Chapman <dave@dchapman.com>2007-03-15 23:55:26 +0000
commit1860e9ad475fe4067ff90af995b7bbd9c9783171 (patch)
treecf330a306853184e7fc799c101a6c448125b29d4
parent7b8bf1b0e764df17c62f90bd34b06b5121a26cf2 (diff)
downloadrockbox-1860e9ad475fe4067ff90af995b7bbd9c9783171.tar.gz
rockbox-1860e9ad475fe4067ff90af995b7bbd9c9783171.tar.bz2
rockbox-1860e9ad475fe4067ff90af995b7bbd9c9783171.zip
Add a further safety check - don't allow users to install old bootloaders with sansapatcher
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12796 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--rbutil/sansapatcher/sansapatcher.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/rbutil/sansapatcher/sansapatcher.c b/rbutil/sansapatcher/sansapatcher.c
index cc1cc8a0a4..aa13df00e5 100644
--- a/rbutil/sansapatcher/sansapatcher.c
+++ b/rbutil/sansapatcher/sansapatcher.c
@@ -623,6 +623,11 @@ int add_bootloader(struct sansa_t* sansa, char* filename, int type)
,bl_length,n);
return -1;
}
+
+ if (memcmp(sectorbuf+0x200+0x1f8,"RBBL",4)!=0) {
+ fprintf(stderr,"[ERR] Not a Rockbox bootloader, aborting.\n");
+ return -1;
+ }
} else {
memcpy(sectorbuf+0x200,bootimg,LEN_bootimg);
}