Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
d567659b
Commit
d567659b
authored
23 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
strtok() replaced with strtok_r()
parent
e0558ae5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/cookie.c
+3
-2
3 additions, 2 deletions
lib/cookie.c
lib/netrc.c
+3
-2
3 additions, 2 deletions
lib/netrc.c
lib/url.c
+3
-2
3 additions, 2 deletions
lib/url.c
with
9 additions
and
6 deletions
lib/cookie.c
+
3
−
2
View file @
d567659b
...
...
@@ -199,6 +199,7 @@ Curl_cookie_add(struct CookieInfo *c,
/* This line is NOT a HTTP header style line, we do offer support for
reading the odd netscape cookies-file format here */
char
*
firstptr
;
char
*
tok_buf
;
int
fields
;
if
(
lineptr
[
0
]
==
'#'
)
{
...
...
@@ -214,7 +215,7 @@ Curl_cookie_add(struct CookieInfo *c,
if
(
ptr
)
*
ptr
=
0
;
/* clear it */
firstptr
=
strtok
(
lineptr
,
"
\t
"
);
/* first tokenize it on the TAB */
firstptr
=
strtok
_r
(
lineptr
,
"
\t
"
,
&
tok_buf
);
/* first tokenize it on the TAB */
/* Here's a quick check to eliminate normal HTTP-headers from this */
if
(
!
firstptr
||
strchr
(
firstptr
,
':'
))
{
...
...
@@ -224,7 +225,7 @@ Curl_cookie_add(struct CookieInfo *c,
/* Now loop through the fields and init the struct we already have
allocated */
for
(
ptr
=
firstptr
,
fields
=
0
;
ptr
;
ptr
=
strtok
(
NULL
,
"
\t
"
),
fields
++
)
{
for
(
ptr
=
firstptr
,
fields
=
0
;
ptr
;
ptr
=
strtok
_r
(
NULL
,
"
\t
"
,
&
tok_buf
),
fields
++
)
{
switch
(
fields
)
{
case
0
:
co
->
domain
=
strdup
(
ptr
);
...
...
This diff is collapsed.
Click to expand it.
lib/netrc.c
+
3
−
2
View file @
d567659b
...
...
@@ -111,8 +111,9 @@ int Curl_parsenetrc(char *host,
file
=
fopen
(
netrcbuffer
,
"r"
);
if
(
file
)
{
char
*
tok
;
char
*
tok_buf
;
while
(
fgets
(
netrcbuffer
,
sizeof
(
netrcbuffer
),
file
))
{
tok
=
strtok
(
netrcbuffer
,
"
\t\n
"
);
tok
=
strtok
_r
(
netrcbuffer
,
"
\t\n
"
,
&
tok_buf
);
while
(
tok
)
{
switch
(
state
)
{
case
NOTHING
:
...
...
@@ -163,7 +164,7 @@ int Curl_parsenetrc(char *host,
}
break
;
}
/* switch (state) */
tok
=
strtok
(
NULL
,
"
\t\n
"
);
tok
=
strtok
_r
(
NULL
,
"
\t\n
"
,
&
tok_buf
);
}
/* while (tok) */
}
/* while fgets() */
...
...
This diff is collapsed.
Click to expand it.
lib/url.c
+
3
−
2
View file @
d567659b
...
...
@@ -1560,6 +1560,7 @@ static CURLcode Connect(struct UrlData *data,
* checked if the lowercase versions don't exist.
*/
char
*
no_proxy
=
NULL
;
char
*
no_proxy_tok_buf
;
char
*
proxy
=
NULL
;
char
proxy_env
[
128
];
...
...
@@ -1571,7 +1572,7 @@ static CURLcode Connect(struct UrlData *data,
/* NO_PROXY wasn't specified or it wasn't just an asterisk */
char
*
nope
;
nope
=
no_proxy
?
strtok
(
no_proxy
,
", "
)
:
NULL
;
nope
=
no_proxy
?
strtok
_r
(
no_proxy
,
", "
,
&
no_proxy_tok_buf
)
:
NULL
;
while
(
nope
)
{
if
(
strlen
(
nope
)
<=
strlen
(
conn
->
name
))
{
char
*
checkn
=
...
...
@@ -1581,7 +1582,7 @@ static CURLcode Connect(struct UrlData *data,
break
;
}
}
nope
=
strtok
(
NULL
,
", "
);
nope
=
strtok
_r
(
NULL
,
", "
,
&
no_proxy_tok_buf
);
}
if
(
!
nope
)
{
/* It was not listed as without proxy */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment