Skip to content

Commit 0dc1056

Browse files
authored
simple fix for single byte overflow on stack. (#52)
* simple fix for single byte overflow on stack. you are writing 3 bytes into a 2 byte array. * Update id3v2.cpp
1 parent 7aa3686 commit 0dc1056

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/id3v2.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3041,10 +3041,11 @@ void APar_ID3FrameAmmend(AtomicInfo *id32_atom,
30413041
} else if (targetFrame->ID3v2_Frame_ID == ID3v2_FRAME_CONTENTTYPE) {
30423042
uint8_t genre_idx = ID3StringGenreToInt(frame_payload);
30433043
if (genre_idx != 0xFF) {
3044-
char genre_str_idx[2];
3044+
char genre_str_idx[4];
30453045
genre_str_idx[0] = 0;
30463046
genre_str_idx[1] = 0;
3047-
genre_str_idx[1] = 0;
3047+
genre_str_idx[2] = 0;
3048+
genre_str_idx[3] = 0;
30483049
sprintf(genre_str_idx, "%u", genre_idx);
30493050
APar_FrameDataPut(
30503051
targetFrame, genre_str_idx, adjunct_payloads, str_encoding);

0 commit comments

Comments
 (0)