[FFmpeg-devel] [PATCH] Handling special characters in a URL.

Michael Niedermayer michaelni at gmx.at
Fri Mar 1 22:05:33 CET 2013


On Fri, Mar 01, 2013 at 08:02:44AM +0530, Senthilnathan Maadasamy wrote:
> On Fri, Mar 1, 2013 at 7:49 AM, Michael Niedermayer <michaelni at gmx.at>wrote:
> 
> > > No.  The previous two comparisons of enc_len with MAX_URL_SIZE make sure
> > > that there is always place for the trailing NULL character.
> >
> > consider component_size == 0
> >
> I tested with component_size as zero and it properly logs the error message
> that buffer size is too small.


+static void percent_encode_url(char *component, size_t component_size = 0,
+                               const char *allowed)
+{
+    char enc[MAX_URL_SIZE], c;
+    int enc_len = 0;
+    char *src = component;
+
+    if (!src) return;
+

+    while (c = *src) {

accesses out of array, src is 0 elements large so any access must be
outside

i dont know if this is the only case where this happens

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130301/1a2d9dad/attachment.asc>


More information about the ffmpeg-devel mailing list