yes I have a title now !

2011/2/12 Enlightenment SVN <[email protected]>

> Log:
> I hereby dub thee, Atton Jonathan, Official Azy Bug Finder.
>
>  fix b64 header detection (random extra trailing newline)
>  also small optimization following this
>
>
> Author:       discomfitor
> Date:         2011-02-12 10:33:38 -0800 (Sat, 12 Feb 2011)
> New Revision: 56969
> Trac:         http://trac.enlightenment.org/e/changeset/56969
>
> Modified:
>  trunk/PROTO/azy/src/lib/azy_events.c
>
> Modified: trunk/PROTO/azy/src/lib/azy_events.c
> ===================================================================
> --- trunk/PROTO/azy/src/lib/azy_events.c        2011-02-12 16:43:59 UTC
> (rev 56968)
> +++ trunk/PROTO/azy/src/lib/azy_events.c        2011-02-12 18:33:38 UTC
> (rev 56969)
> @@ -300,7 +300,25 @@
>              if ((x - r) > 0)
>                s = "\r\n";
>              else
> -               s = "\n\r";
> +               { /* we currently have \n\r: b64 encoding can leave a
> trailing \n
> +                  * so we have to check for an extra \n
> +                  */
> +                  if ((x - r < 0) && ((unsigned int)(r + 1 - start) < len)
> && (r[1] == '\n'))
> +                    { /* \n\r\n */
> +                       if (((unsigned int)(r + 2 - start) < len) && (r[2]
> == '\r'))
> +                         { /* \n\r\n\r */
> +                            if (((unsigned int)(r + 3 - start) < len) &&
> (r[3] == '\n'))
> +                              /* \n\r\n\r\n oh hey I'm gonna stop here
> before it gets too insane */
> +                              s = "\r\n";
> +                            else
> +                              s = "\n\r";
> +                         }
> +                       else
> +                         s = "\r\n";
> +                    }
> +                  else
> +                    s = "\n\r";
> +               }
>           }
>         else
>           s = "\r";
> @@ -311,7 +329,7 @@
>    slen = strlen(s);
>    snprintf((char *)sep, sizeof(sep), "%s%s", s, s);
>    /* by spec, this is only found between header and content */
> -   if (azy_memstr(start, sep, len, 2 * slen))
> +   if (azy_memstr(r - 1, sep, len - (r - 1 - start), 2 * slen))
>      net->headers_read = EINA_TRUE;
>
>    p = start;
>
>
>
> ------------------------------------------------------------------------------
> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
> Pinpoint memory and threading errors before they happen.
> Find and fix more than 250 security defects in the development cycle.
> Locate bottlenecks in serial and parallel code that limit performance.
> http://p.sf.net/sfu/intel-dev2devfeb
> _______________________________________________
> enlightenment-svn mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
>



-- 
Regards.
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to