From aaf2942001625d82109e1ebf50a05aef29c65dca Mon Sep 17 00:00:00 2001 From: gohai Date: Mon, 18 Jul 2011 23:56:12 +0200 Subject: fix off-by-one in convstr_id3v2 The previous check started with the semi-last character and went forward. This erroneously truncated strings such as 00 52 41 54 49 4e 47 00 33 (a TXXX with "RATING", followed by a 00 and a single byte value). --- junklib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'junklib.c') diff --git a/junklib.c b/junklib.c index 530fd51f..45e98405 100644 --- a/junklib.c +++ b/junklib.c @@ -734,7 +734,7 @@ convstr_id3v2 (int version, uint8_t encoding, const unsigned char* str, int sz) } } // trim trailing linebreaks - for (n = converted_sz-2; n >= 0; n--) { + for (n = converted_sz-1; n >= 0; n--) { if (out[n] == '\n') { out[n] = 0; } -- cgit v1.2.3