Closed sezero closed 2 years ago
- ASY_Load: avoid uninitialized reads from
DupStr
(605e9f3)
This looks OK to me. The ASYLUM format doesn't have a module name field that I've ever seen, and I don't know why this loader has a struct member for it. I don't think I've seen 22 char sample names in them but IIRC they're valid in MODs and it's likely MOD2AMF outputs whatever sample names it was given.
- MikMod_InfoDriver: ensure proper nul termination of list (9db6d2f)
I can't tell if this one was actually a problem or not (I think it would have output ## \0
for the final entry?), but the new handling is cleaner. This seems OK.
- mikmod player, mconfedit.c: make
skip_number
saner (2a1b1f6)
This looks OK to me. The *str
conditions might be redundant, but they don't hurt. (Also, LOL at the signed-to-signed casts for isdigit
.)
Thanks for the reviews
- MikMod_InfoDriver: ensure proper nul termination of list (9db6d2f)
I can't tell if this one was actually a problem or not (I think it would have output
## \0
for the final entry?), but the new handling is cleaner. This seems OK.
This showed itself in mikmod player when you hit c
where it plays with the driver list in evil ways, and skip_number
used to hit an uninitialized byte.
The
*str
conditions might be redundant, but they don't hurt.
Well yeah, I was blind I guess. Removed them.
Changed MikMod_malloc to use plain malloc and not calloc, as of commit 544deb0. The defects revealed by this, i.e. several unitialized memory reads here and there, has been fixed so far. Let's be on the watch for any remaining issues - long live valgrind...
Closing this ticket.
Changing MikMod_malloc to use plain malloc and not calloc revealed actual defects, i.e. unitialized memory reads here and there.
So far, I pushed the following commits to fix the ones I encountered:
DupStr
(https://github.com/sezero/mikmod/commit/605e9f3474efcacb7846196bc5206b65a08593dd)skip_number
saner (https://github.com/sezero/mikmod/commit/2a1b1f6659b77f90da19e158a6c22319d6712b2a)More may follow.
@AliceLR: Can you have a look at the last three commits to make sure they are correct?