[libbdplus-devel] Fix use after free
anonymous
git at videolan.org
Thu Jan 8 10:44:52 CET 2015
libbdplus | branch: master | anonymous <anonymous at anonymous.org> | Thu Jan 8 11:35:36 2015 +0200| [50e47aeb93bb96dd0bb945a451b753fd9b44f490] | committer: anonymous
Fix use after free
> http://git.videolan.org/gitweb.cgi/libbdplus.git/?a=commit;h=50e47aeb93bb96dd0bb945a451b753fd9b44f490
---
src/libbdplus/bdsvm/trap.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/libbdplus/bdsvm/trap.c b/src/libbdplus/bdsvm/trap.c
index d97f920..6d779f7 100644
--- a/src/libbdplus/bdsvm/trap.c
+++ b/src/libbdplus/bdsvm/trap.c
@@ -1179,18 +1179,18 @@ uint32_t TRAP_LoadContentCode(const char *device_path, uint8_t *FileName, uint32
fd = fopen((char *)fname, "rb");
X_FREE(fname);
if (!fd) {
- DEBUG(DBG_BDPLUS | DBG_CRIT,"[TRAP] ERROR: cant open %s\n", (char*)fname);
+ DEBUG(DBG_BDPLUS | DBG_CRIT,"[TRAP] ERROR: cant open %s\n", (char*)FileName);
return STATUS_INVALID_PARAMETER; // FIXME
}
// Skip the SVM header.
if (fseek(fd, SVM_HEADER_SIZE, SEEK_SET) < 0) {
- DEBUG(DBG_BDPLUS | DBG_CRIT,"[TRAP] ERROR: seeking %s (header) failed\n", (char*)fname);
+ DEBUG(DBG_BDPLUS | DBG_CRIT,"[TRAP] ERROR: seeking %s (header) failed\n", (char*)FileName);
fclose(fd);
return STATUS_INVALID_PARAMETER;
}
if (fseek(fd, Section * 0x200000, SEEK_CUR) < 0) { // locate wanted section
- DEBUG(DBG_BDPLUS | DBG_CRIT,"[TRAP] ERROR: seeking %s to section %d failed\n", (char*)fname, Section);
+ DEBUG(DBG_BDPLUS | DBG_CRIT,"[TRAP] ERROR: seeking %s to section %d failed\n", (char*)FileName, Section);
fclose(fd);
return STATUS_INVALID_PARAMETER;
}
@@ -1200,7 +1200,7 @@ uint32_t TRAP_LoadContentCode(const char *device_path, uint8_t *FileName, uint32
DEBUG(DBG_BDPLUS,"[TRAP] reading %d/%08X bytes into %p\n", *len, *len, dst);
rbytes = fread(dst, 1, *len, fd);
if (rbytes < 0 || rbytes != (int64_t)*len) {
- DEBUG(DBG_BDPLUS | DBG_CRIT,"[TRAP] ERROR: read %"PRId64" bytes of %d from %s\n", rbytes, *len, (char*)fname);
+ DEBUG(DBG_BDPLUS | DBG_CRIT,"[TRAP] ERROR: read %"PRId64" bytes of %d from %s\n", rbytes, *len, (char*)FileName);
fclose(fd);
return STATUS_INVALID_PARAMETER;
}
More information about the libbdplus-devel
mailing list