Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
533d6dbf
Commit
533d6dbf
authored
Apr 29, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use strlcpy()
parent
83d33207
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
13 deletions
+6
-13
src/network/getaddrinfo.c
src/network/getaddrinfo.c
+5
-11
src/stream_output/sap.c
src/stream_output/sap.c
+1
-2
No files found.
src/network/getaddrinfo.c
View file @
533d6dbf
...
...
@@ -25,7 +25,7 @@
#include <vlc/vlc.h>
#include <stddef.h>
/* size_t */
#include <string.h>
/* str
ncpy(), str
len(), memcpy(), memset(), strchr() */
#include <string.h>
/* strlen(), memcpy(), memset(), strchr() */
#include <stdlib.h>
/* malloc(), free(), strtoul() */
#include <errno.h>
...
...
@@ -175,8 +175,7 @@ __getnameinfo( const struct sockaddr *sa, socklen_t salen,
if
(
hent
!=
NULL
)
{
strncpy
(
host
,
hent
->
h_name
,
hostlen
);
host
[
hostlen
-
1
]
=
'\0'
;
strlcpy
(
host
,
hent
->
h_name
,
hostlen
);
/*
* only keep first part of hostname
...
...
@@ -199,11 +198,8 @@ __getnameinfo( const struct sockaddr *sa, socklen_t salen,
}
if
(
!
solved
)
{
/* inet_ntoa() can't fail */
strncpy
(
host
,
inet_ntoa
(
addr
->
sin_addr
),
hostlen
);
host
[
hostlen
-
1
]
=
'\0'
;
}
strlcpy
(
host
,
inet_ntoa
(
addr
->
sin_addr
),
hostlen
);
}
if
(
serv
!=
NULL
)
...
...
@@ -222,8 +218,7 @@ __getnameinfo( const struct sockaddr *sa, socklen_t salen,
?
"udp"
:
"tcp"
);
if
(
sent
!=
NULL
)
{
strncpy
(
serv
,
sent
->
s_name
,
servlen
);
serv
[
servlen
-
1
]
=
0
;
strlcpy
(
serv
,
sent
->
s_name
,
servlen
);
solved
=
1
;
}
}
...
...
@@ -636,8 +631,7 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node,
}
else
{
strncpy
(
psz_buf
,
node
,
NI_MAXHOST
);
psz_buf
[
NI_MAXHOST
-
1
]
=
'\0'
;
strlcpy
(
psz_buf
,
node
,
NI_MAXHOST
);
psz_node
=
psz_buf
;
...
...
src/stream_output/sap.c
View file @
533d6dbf
...
...
@@ -602,8 +602,7 @@ static char *SDPGenerate( sap_handler_t *p_sap,
{
char
*
ptr
;
strncpy
(
psz_uribuf
,
p_session
->
psz_uri
+
1
,
sizeof
(
psz_uribuf
)
);
psz_uribuf
[
sizeof
(
psz_uribuf
)
-
1
]
=
'\0'
;
strlcpy
(
psz_uribuf
,
p_session
->
psz_uri
+
1
,
sizeof
(
psz_uribuf
)
);
ptr
=
strchr
(
psz_uribuf
,
'%'
);
if
(
ptr
!=
NULL
)
*
ptr
=
'\0'
;
...
...
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