Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
986116e2
Commit
986116e2
authored
Sep 15, 2003
by
zorglub
Browse files
Fix for bad SAP packets with no \0 between headers and payload
parent
1b24f8ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/misc/sap.c
View file @
986116e2
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* sap.c : SAP interface module
* sap.c : SAP interface module
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* Copyright (C) 2001 VideoLAN
* $Id: sap.c,v 1.2
2
2003/09/1
1 15:34:16
zorglub Exp $
* $Id: sap.c,v 1.2
3
2003/09/1
5 08:33:29
zorglub Exp $
*
*
* Authors: Arnaud Schauly <gitan@via.ecp.fr>
* Authors: Arnaud Schauly <gitan@via.ecp.fr>
* Clment Stenac <zorglub@via.ecp.fr>
* Clment Stenac <zorglub@via.ecp.fr>
...
@@ -590,6 +590,14 @@ static int parse_sap( char *p_packet )
...
@@ -590,6 +590,14 @@ static int parse_sap( char *p_packet )
//Looks for the first '\0' byte after length
//Looks for the first '\0' byte after length
for
(;
p_packet
[
i_hlen
]
!=
'\0'
;
i_hlen
++
);
for
(;
p_packet
[
i_hlen
]
!=
'\0'
;
i_hlen
++
);
if
(
i_hlen
>
50
)
/* Definitely too long...
Maybe we have a fucked up packet without \0 */
{
/* As a workaround, we search for "v=" */
i_hlen
=
4
;
for
(;
p_packet
[
i_hlen
]
!=
'v'
&&
p_packet
[
i_hlen
+
1
]
!=
'='
;
i_hlen
++
);
return
i_hlen
-
1
;
}
return
(
i_hlen
);
return
(
i_hlen
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment