cvs: pecl /id3 id3.c
| From: | Carsten Lucke | Date: | Wed, 01 Sep 2004 20:40:15 +0000 |
| Subject: | cvs: pecl /id3 id3.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-1769@lists.php.net to get a copy of this message | ||
luckec Wed Sep 1 16:40:15 2004 EDT
Modified files:
/pecl/id3 id3.c
Log:
added check for content-size in textframe-parser function
http://cvs.php.net/diff.php/pecl/id3/id3.c?r1=1.22&r2=1.23&ty=u
Index: pecl/id3/id3.c
diff -u pecl/id3/id3.c:1.22 pecl/id3/id3.c:1.23
--- pecl/id3/id3.c:1.22 Wed Sep 1 16:27:32 2004
+++ pecl/id3/id3.c Wed Sep 1 16:40:15 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: id3.c,v 1.22 2004/09/01 20:27:32 luckec Exp $ */
+/* $Id: id3.c,v 1.23 2004/09/01 20:40:15 luckec Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -748,8 +748,16 @@
/*
TODO: handle encoding
*/
+ /* read the frame's encoding byte */
encoding = frameContent[0];
infoSize = sFrameHeader->size - 1;
+
+ /* leave, if actual content-size (framesize - 1Byte for encoding flag)
+ is not greater zero */
+ if (! (infoSize > 0)) {
+ return 0;
+ }
+
information = emalloc(infoSize);
_php_strnoffcpy(information, frameContent, 1, infoSize TSRMLS_CC);