Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor 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
Sebastian Dröge
VLC
Commits
abf527b5
Commit
abf527b5
authored
3 years ago
by
Thomas Guillem
Committed by
Jean-Baptiste Kempf
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
samba: limit the read size
Fixes
#22909
parent
e71404e5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/access/samba.c
+10
-0
10 additions, 0 deletions
modules/access/samba.c
with
10 additions
and
0 deletions
modules/access/samba.c
+
10
−
0
View file @
abf527b5
...
...
@@ -101,6 +101,16 @@ static ssize_t Read( stream_t *p_access, void *p_buffer, size_t i_len )
access_sys_t
*
p_sys
=
p_access
->
p_sys
;
int
i_read
;
/* cf. DEFAULT_SMB2_MAX_READ (= 8MB) from the samba project. Reading more
* than this limit will likely result on a ECONNABORTED
* (STATUS_CONNECTION_ABORTED) error. Since this value can be lowered by
* the server, let decrease this limit (/8) to have more chance to get a
* working limit on our side.
* XXX: There is no way to retrieve this value when using the old smbc_*
* interface. */
if
(
i_len
>
(
1024
<<
10
)
)
/* 8MB / 8 = 1MB */
i_len
=
1024
<<
10
;
i_read
=
smbc_read
(
p_sys
->
i_smb
,
p_buffer
,
i_len
);
if
(
i_read
<
0
)
{
...
...
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