Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
0f03eb91
Commit
0f03eb91
authored
Dec 12, 2003
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Fix segfault when we have two announces with the same URI but different names on the network
parent
69a02cbe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
18 deletions
+45
-18
modules/misc/sap.c
modules/misc/sap.c
+45
-18
No files found.
modules/misc/sap.c
View file @
0f03eb91
...
@@ -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.4
2 2003/12/11 20:40:37
zorglub Exp $
* $Id: sap.c,v 1.4
3 2003/12/12 15:37:23
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>
...
@@ -635,10 +635,8 @@ static void sess_toitem( intf_thread_t * p_intf, sess_descr_t * p_sd )
...
@@ -635,10 +635,8 @@ static void sess_toitem( intf_thread_t * p_intf, sess_descr_t * p_sd )
for
(
i
=
0
;
i
<
p_intf
->
p_sys
->
i_announces
;
i
++
)
for
(
i
=
0
;
i
<
p_intf
->
p_sys
->
i_announces
;
i
++
)
{
{
if
(
!
strcmp
(
p_intf
->
p_sys
->
pp_announces
[
i
]
->
psz_name
,
if
(
!
strcmp
(
p_intf
->
p_sys
->
pp_announces
[
i
]
->
psz_uri
,
p_item
->
psz_name
)
&&
p_item
->
psz_uri
)
)
!
strcmp
(
p_intf
->
p_sys
->
pp_announces
[
i
]
->
psz_uri
,
p_item
->
psz_uri
)
)
{
{
return
;
return
;
}
}
...
@@ -647,9 +645,23 @@ static void sess_toitem( intf_thread_t * p_intf, sess_descr_t * p_sd )
...
@@ -647,9 +645,23 @@ static void sess_toitem( intf_thread_t * p_intf, sess_descr_t * p_sd )
playlist_AddItem
(
p_playlist
,
p_item
,
PLAYLIST_CHECK_INSERT
,
PLAYLIST_END
);
playlist_AddItem
(
p_playlist
,
p_item
,
PLAYLIST_CHECK_INSERT
,
PLAYLIST_END
);
vlc_object_release
(
p_playlist
);
vlc_object_release
(
p_playlist
);
p_announce
=
(
struct
sap_announce_t
*
)
malloc
(
p_announce
=
(
struct
sap_announce_t
*
)
malloc
(
sizeof
(
struct
sap_announce_t
*
)
);
sizeof
(
struct
sap_announce_t
)
);
p_announce
->
psz_name
=
strdup
(
p_item
->
psz_name
);
if
(
p_item
->
psz_name
)
p_announce
->
psz_uri
=
strdup
(
p_item
->
psz_uri
);
{
p_announce
->
psz_name
=
strdup
(
p_item
->
psz_name
);
}
else
{
p_announce
->
psz_name
=
strdup
(
""
);
}
if
(
p_item
->
psz_uri
)
{
p_announce
->
psz_uri
=
strdup
(
p_item
->
psz_uri
);
}
else
{
p_announce
->
psz_uri
=
strdup
(
""
);
}
INSERT_ELEM
(
p_intf
->
p_sys
->
pp_announces
,
INSERT_ELEM
(
p_intf
->
p_sys
->
pp_announces
,
p_intf
->
p_sys
->
i_announces
,
p_intf
->
p_sys
->
i_announces
,
...
@@ -748,7 +760,6 @@ static void sess_toitem( intf_thread_t * p_intf, sess_descr_t * p_sd )
...
@@ -748,7 +760,6 @@ static void sess_toitem( intf_thread_t * p_intf, sess_descr_t * p_sd )
}
}
}
}
/* Filling p_item->psz_uri */
/* Filling p_item->psz_uri */
if
(
b_http
==
VLC_FALSE
)
if
(
b_http
==
VLC_FALSE
)
{
{
...
@@ -785,22 +796,38 @@ static void sess_toitem( intf_thread_t * p_intf, sess_descr_t * p_sd )
...
@@ -785,22 +796,38 @@ static void sess_toitem( intf_thread_t * p_intf, sess_descr_t * p_sd )
for
(
i
=
0
;
i
<
p_intf
->
p_sys
->
i_announces
;
i
++
)
for
(
i
=
0
;
i
<
p_intf
->
p_sys
->
i_announces
;
i
++
)
{
{
if
(
!
strcmp
(
p_intf
->
p_sys
->
pp_announces
[
i
]
->
psz_name
,
if
(
!
strcmp
(
p_intf
->
p_sys
->
pp_announces
[
i
]
->
psz_uri
,
p_item
->
psz_name
)
&&
p_item
->
psz_uri
)
)
!
strcmp
(
p_intf
->
p_sys
->
pp_announces
[
i
]
->
psz_uri
,
p_item
->
psz_uri
)
)
{
{
return
;
return
;
}
}
}
}
/* Enqueueing p_item in the playlist */
/* Enqueueing p_item in the playlist */
p_playlist
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
p_playlist
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
playlist_AddItem
(
p_playlist
,
p_item
,
PLAYLIST_CHECK_INSERT
,
PLAYLIST_END
);
FIND_ANYWHERE
);
playlist_AddItem
(
p_playlist
,
p_item
,
PLAYLIST_CHECK_INSERT
,
PLAYLIST_END
);
/* Store it in the list */
p_announce
=
(
struct
sap_announce_t
*
)
malloc
(
p_announce
=
(
struct
sap_announce_t
*
)
malloc
(
sizeof
(
struct
sap_announce_t
*
)
);
sizeof
(
struct
sap_announce_t
)
);
p_announce
->
psz_name
=
strdup
(
p_item
->
psz_name
);
if
(
p_item
->
psz_name
)
p_announce
->
psz_uri
=
strdup
(
p_item
->
psz_uri
);
{
p_announce
->
psz_name
=
strdup
(
p_item
->
psz_name
);
}
else
{
p_announce
->
psz_name
=
strdup
(
""
);
}
if
(
p_item
->
psz_uri
)
{
p_announce
->
psz_uri
=
strdup
(
p_item
->
psz_uri
);
}
else
{
p_announce
->
psz_uri
=
strdup
(
""
);
}
INSERT_ELEM
(
p_intf
->
p_sys
->
pp_announces
,
INSERT_ELEM
(
p_intf
->
p_sys
->
pp_announces
,
p_intf
->
p_sys
->
i_announces
,
p_intf
->
p_sys
->
i_announces
,
...
...
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