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
5d4bceda
Commit
5d4bceda
authored
24 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
removed URL size restrictions, dynamically allocates the needed buffer
size instead
parent
42280e95
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/urlglob.c
+9
-5
9 additions, 5 deletions
src/urlglob.c
with
9 additions
and
5 deletions
src/urlglob.c
+
9
−
5
View file @
5d4bceda
...
...
@@ -49,7 +49,7 @@
#include
"../lib/memdebug.h"
#endif
char
glob_buffer
[
URL_MAX_LENGTH
]
;
char
*
glob_buffer
;
URLGlob
*
glob_expand
;
int
glob_word
(
char
*
,
int
);
...
...
@@ -210,10 +210,13 @@ int glob_word(char *pattern, int pos) {
int
glob_url
(
URLGlob
**
glob
,
char
*
url
,
int
*
urlnum
)
{
if
(
strlen
(
url
)
>
URL_MAX_LENGTH
)
{
printf
(
"Illegally sized URL
\n
"
);
return
CURLE_URL_MALFORMAT
;
}
/*
* We can deal with any-size, just make a buffer with the same length
* as the specified URL!
*/
glob_buffer
=
(
char
*
)
malloc
(
strlen
(
url
)
+
1
);
if
(
NULL
==
glob_buffer
)
return
CURLE_OUT_OF_MEMORY
;
glob_expand
=
(
URLGlob
*
)
malloc
(
sizeof
(
URLGlob
));
glob_expand
->
size
=
0
;
...
...
@@ -238,6 +241,7 @@ void glob_cleanup(URLGlob* glob) {
}
}
free
(
glob
);
free
(
glob_buffer
);
}
char
*
next_url
(
URLGlob
*
glob
)
...
...
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