Skip to content

Commit a509649

Browse files
tanghaowillowstv0g
authored andcommittedAug 8, 2023
Fix: check value length in parseTimeUnits
1 parent c870d62 commit a509649

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎unmarshal.go

+3
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,9 @@ func unmarshalMediaAttribute(l *lexer) (stateFn, error) {
876876
}
877877

878878
func parseTimeUnits(value string) (num int64, err error) {
879+
if len(value) == 0 {
880+
return 0, fmt.Errorf("%w `%v`", errSDPInvalidValue, value)
881+
}
879882
k := timeShorthand(value[len(value)-1])
880883
if k > 0 {
881884
num, err = strconv.ParseInt(value[:len(value)-1], 10, 64)

0 commit comments

Comments
 (0)
Please sign in to comment.