mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-27 03:50:29 +00:00
src/sd2.c : Validate data before using.
This commit is contained in:
parent
5a93e505ce
commit
e840299f8b
@ -1,3 +1,8 @@
|
||||
2009-02-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||
|
||||
* src/sd2.c
|
||||
Validate data before using.
|
||||
|
||||
2009-02-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||
|
||||
* Octave/octave_test.sh
|
||||
|
@ -477,6 +477,12 @@ sd2_parse_rsrc_fork (SF_PRIVATE *psf)
|
||||
goto parse_rsrc_fork_cleanup ;
|
||||
} ;
|
||||
|
||||
if (rsrc.map_offset + 26 >= rsrc.rsrc_len)
|
||||
{ psf_log_printf (psf, "Bad map offset (%d + 26 > %d).\n", rsrc.map_offset, rsrc.rsrc_len) ;
|
||||
error = SFE_SD2_BAD_RSRC ;
|
||||
goto parse_rsrc_fork_cleanup ;
|
||||
} ;
|
||||
|
||||
rsrc.string_offset = rsrc.map_offset + read_short (rsrc.rsrc_data, rsrc.map_offset + 26) ;
|
||||
if (rsrc.string_offset > rsrc.rsrc_len)
|
||||
{ psf_log_printf (psf, "Bad string offset (%d).\n", rsrc.string_offset) ;
|
||||
|
Loading…
Reference in New Issue
Block a user