@@ -1750,7 +1750,15 @@ arc_process_set(ARC_MESSAGE *msg,
1750
1750
}
1751
1751
ARC_FREE (hcopy );
1752
1752
1753
- /* test validity of "t", "x", and "i" */
1753
+ /* test validity of "l", "t", "x", and "i" */
1754
+ p = arc_param_get (set , "l" );
1755
+ if (p != NULL && !arc_check_uint (p , NULL ))
1756
+ {
1757
+ arc_error (msg , "invalid \"l\" value in %s data" , settype );
1758
+ set -> set_bad = true;
1759
+ return ARC_STAT_SYNTAX ;
1760
+ }
1761
+
1754
1762
p = arc_param_get (set , "t" );
1755
1763
if (p != NULL )
1756
1764
{
@@ -2732,6 +2740,7 @@ arc_eoh_verify(ARC_MESSAGE *msg)
2732
2740
{
2733
2741
unsigned int n ;
2734
2742
unsigned int hashtype ;
2743
+ uint64_t len ;
2735
2744
char * c ;
2736
2745
ARC_STAT status ;
2737
2746
struct arc_hdrfield * h = NULL ;
@@ -2819,6 +2828,16 @@ arc_eoh_verify(ARC_MESSAGE *msg)
2819
2828
body_canon = ARC_CANON_SIMPLE ;
2820
2829
}
2821
2830
2831
+ c = arc_param_get (h -> hdr_data , "l" );
2832
+ if (c != NULL )
2833
+ {
2834
+ arc_check_uint (c , & len );
2835
+ }
2836
+ else
2837
+ {
2838
+ len = -1 ;
2839
+ }
2840
+
2822
2841
status = arc_add_canon (msg , ARC_CANONTYPE_HEADER , hdr_canon , hashtype ,
2823
2842
htag , h , (ssize_t ) -1 , & msg -> arc_hdrcanons [n ]);
2824
2843
@@ -2831,7 +2850,7 @@ arc_eoh_verify(ARC_MESSAGE *msg)
2831
2850
2832
2851
/* body, validation */
2833
2852
status = arc_add_canon (msg , ARC_CANONTYPE_BODY , body_canon , hashtype ,
2834
- NULL , NULL , (ssize_t ) -1 ,
2853
+ NULL , NULL , (ssize_t ) len ,
2835
2854
& msg -> arc_bodycanons [n ]);
2836
2855
2837
2856
if (status != ARC_STAT_OK )
0 commit comments