[xiph-cvs] cvs commit: ices/src Makefile.am id3.c

Brendan brendan at xiph.org
Sun Mar 9 00:02:26 PST 2003



brendan     03/03/09 03:02:26

  Modified:    src      Makefile.am id3.c
  Log:
  Oops, null-terminate ID3v2 tag strings before copying them.

Revision  Changes    Path
1.25      +1 -2      ices/src/Makefile.am

Index: Makefile.am
===================================================================
RCS file: /cvs/ice/ices/src/Makefile.am,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- Makefile.am	8 Mar 2003 23:55:58 -0000	1.24
+++ Makefile.am	9 Mar 2003 08:02:26 -0000	1.25
@@ -17,6 +17,5 @@
 
 BUILT_SOURCES = $(ICES_OBJECTS)
 
-ices_LDADD = $(ICES_OBJECTS) playlist/libplaylist.a
-
 ices_CPPFLAGS = -DICES_ETCDIR=\"$(sysconfdir)\" -DICES_MODULEDIR=\"$(moddir)\"
+ices_LDADD = $(ICES_OBJECTS) playlist/libplaylist.a

<p><p>1.22      +3 -1      ices/src/id3.c

Index: id3.c
===================================================================
RCS file: /cvs/ice/ices/src/id3.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- id3.c	5 Mar 2003 22:54:35 -0000	1.21
+++ id3.c	9 Mar 2003 08:02:26 -0000	1.22
@@ -250,7 +250,7 @@
 
   /* ices_log_debug("ID3v2: Frame type [%s] found, %d bytes", hdr, len); */
   if (!strcmp (hdr, ID3V2_ARTIST_TAG(tag)) || !strcmp (hdr, ID3V2_TITLE_TAG(tag))) {
-    if (! (buf = malloc(len))) {
+    if (! (buf = malloc(len+1))) {
       ices_log ("Error allocating memory while reading ID3v2 frame");
       
       return -1;
@@ -269,9 +269,11 @@
 
     /* skip encoding */
     if (!strcmp (hdr, ID3V2_TITLE_TAG(tag))) {
+      buf[len] = '\0';
       ices_log_debug ("ID3v2: Title found: %s", buf + 1);
       tag->title = ices_util_strdup (buf + 1);
     } else {
+      buf[len] = '\0';
       ices_log_debug ("ID3v2: Artist found: %s", buf + 1);
       tag->artist = ices_util_strdup (buf + 1);
     }

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list