changeset 1192:62726fb1cb3b trunk

[svn] - fix potential crashing on malformed ID3v2 tags
author nenolod
date Tue, 13 Jun 2006 01:59:28 -0700
parents 4abdab413cf6
children 03414b9d2507
files ChangeLog Plugins/General/scrobbler/tags/id3v2.c Plugins/General/scrobbler/tags/unicode.c
diffstat 3 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Jun 12 03:25:29 2006 -0700
+++ b/ChangeLog	Tue Jun 13 01:59:28 2006 -0700
@@ -1,3 +1,11 @@
+2006-06-12 10:25:29 +0000  Tony Vroon <chainsaw@gentoo.org>
+  revision [1292]
+  Updated japanese translation by dai, closes bug #384.
+
+  Changes:        Modified:
+  +826 -811       trunk/po/ja.po  
+
+
 2006-06-12 07:56:00 +0000  William Pitcock <nenolod@nenolod.net>
   revision [1290]
   - new UI for scrobbler configuration UI
--- a/Plugins/General/scrobbler/tags/id3v2.c	Mon Jun 12 03:25:29 2006 -0700
+++ b/Plugins/General/scrobbler/tags/id3v2.c	Tue Jun 13 01:59:28 2006 -0700
@@ -430,6 +430,10 @@
 			utf = realloc(utf, framedata->len);
 			strcpy((char*)utf, (char*)data);
 		}
+
+		if (utf == NULL)
+			return framedata;
+
 		framedata->len = strlen((char*)utf) + 1;
 		framedata->data = realloc(framedata->data, framedata->len);
 		strcpy((char*)framedata->data, (char*)utf);
--- a/Plugins/General/scrobbler/tags/unicode.c	Mon Jun 12 03:25:29 2006 -0700
+++ b/Plugins/General/scrobbler/tags/unicode.c	Tue Jun 13 01:59:28 2006 -0700
@@ -31,6 +31,9 @@
 	int j = 0;
 	wchar_t *mem;
 
+	if (utf == NULL)
+		return NULL;
+
 	mem = calloc(sizeof(wchar_t) * (memsize + 1), 1);
 
 	for(i = 0; i < memsize;)
@@ -88,6 +91,9 @@
 {
 	size_t i;
 	unsigned char *mem, *ptr;
+
+	if (wchar == NULL)
+		return NULL;
 	
 	mem = calloc(memsize * 6 + 1, 1);
 	ptr = mem;