add fuzz tests to all headers (#522)

This commit is contained in:
Alessandro Ros
2024-02-22 12:08:42 +01:00
committed by GitHub
parent 55fa72f0c2
commit c93d5c54d9
32 changed files with 177 additions and 326 deletions

View File

@@ -39,10 +39,13 @@ func (h *RTPInfo) Unmarshal(v base.HeaderValue) error {
return err
}
urlReceived := false
for k, v := range kvs {
switch k {
case "url":
e.URL = v
urlReceived = true
case "seq":
vi, err := strconv.ParseUint(v, 10, 16)
@@ -65,7 +68,7 @@ func (h *RTPInfo) Unmarshal(v base.HeaderValue) error {
}
}
if e.URL == "" {
if !urlReceived {
return fmt.Errorf("URL is missing")
}