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
a2926ebe
Commit
a2926ebe
authored
17 years ago
by
Yang Tse
Browse files
Options
Downloads
Patches
Plain Diff
Fix a variable potential wrapping in add_buffer() when using absolutely
huge send buffer sizes
parent
c508d702
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
CHANGES
+4
-0
4 additions, 0 deletions
CHANGES
RELEASE-NOTES
+1
-0
1 addition, 0 deletions
RELEASE-NOTES
lib/http.c
+20
-1
20 additions, 1 deletion
lib/http.c
with
25 additions
and
1 deletion
CHANGES
+
4
−
0
View file @
a2926ebe
...
...
@@ -6,6 +6,10 @@
Changelog
Yang Tse (14 Nov 2007)
- Fix a variable potential wrapping in add_buffer() when using absolutely
huge send buffer sizes.
Daniel S (13 Nov 2007)
- Fixed a remaining problem with doing SFTP directory listings on a re-used
persistent connection. Mentioned by Immanuel Gregoire on the mailing list.
...
...
This diff is collapsed.
Click to expand it.
RELEASE-NOTES
+
1
−
0
View file @
a2926ebe
...
...
@@ -20,6 +20,7 @@ This release includes the following bugfixes:
o curl.h version 7.17.1 problem when building C++ apps with MSVC
o SFTP and SCP use persistent connections
o segfault on bad URL
o variable wrapping when using absolutely huge send buffer sizes
This release includes the following known bugs:
...
...
This diff is collapsed.
Click to expand it.
lib/http.c
+
20
−
1
View file @
a2926ebe
...
...
@@ -1083,9 +1083,28 @@ CURLcode add_buffer(send_buffer *in, const void *inptr, size_t size)
char
*
new_rb
;
size_t
new_size
;
if
(
~
size
<
in
->
size_used
)
{
/* If resulting used size of send buffer would wrap size_t, cleanup
the whole buffer and return error. Otherwise the required buffer
size will fit into a single allocatable memory chunk */
Curl_safefree
(
in
->
buffer
);
free
(
in
);
return
CURLE_OUT_OF_MEMORY
;
}
if
(
!
in
->
buffer
||
((
in
->
size_used
+
size
)
>
(
in
->
size_max
-
1
)))
{
new_size
=
(
in
->
size_used
+
size
)
*
2
;
/* If current buffer size isn't enough to hold the result, use a
buffer size that doubles the required size. If this new size
would wrap size_t, then just use the largest possible one */
if
((
size
>
(
size_t
)
-
1
/
2
)
||
(
in
->
size_used
>
(
size_t
)
-
1
/
2
)
||
(
~
(
size
*
2
)
<
(
in
->
size_used
*
2
)))
new_size
=
(
size_t
)
-
1
;
else
new_size
=
(
in
->
size_used
+
size
)
*
2
;
if
(
in
->
buffer
)
/* we have a buffer, enlarge the existing one */
new_rb
=
(
char
*
)
realloc
(
in
->
buffer
,
new_size
);
...
...
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