[AWS] Minor bug in src/core/aws-headers-set.adb

Pascal Obry pascal at obry.net
Sat Oct 8 16:29:29 CEST 2011


Hello Riccardo,

> I think I found a minor bug in the header parsing routine in
> src/core/aws-headers-set.adb.  The bug is really a minor one, mostly
> harmless and almost impossible to trigger, if not on purpose.  Anyway,
> if you look at lines 106-121 in the above mentioned file you'll see

Indeed, good catch! This would tighten up the parsing.

> ========= BEGIN
>                     Delimiter_Index := Fixed.Index (Source =>  Line,
>                                                     Set    =>  RFC2616_Token_Set,
>                                                     Test   =>  Outside);
>
>                     if Delimiter_Index = 0 -- No delimiter
>                        or else
>                           Delimiter_Index = Line'First -- Empty name
>                           or else
>                              Line (Delimiter_Index) /= ':'
>                     then
>                        --  If we are here, this is not a valid Header Line
>
>                        raise Format_Error with Line;
>                     end if;
> ======== END

Looks good.

> where RFC2616_Token_Set is defined as follows
>
> ======= BEGIN
>      Printable_Set : constant Maps.Character_Set := Maps.To_Set
>         (Maps.Character_Range'(Low  =>  ' ',
>                                High =>  Character'Val (127)));
>
>      RFC2616_Separator_Set : constant Maps.Character_Set := Maps.To_Set
>         (" ()<>@,;:\""/[]?="&  Latin_1.HT);

You seem to have forgotten '{' and '}', was this intentional?

>      RFC2616_Token_Set     : constant Maps.Character_Set :=
>                                Printable_Set - RFC2616_Separator_Set;
> ======= END
>
> Hope this helps.

Thanks.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|    http://www.obry.net  -  http://v2p.fr.eu.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B



More information about the AWS mailing list