[vlc-commits] [Git][videolan/vlc][3.0.x] samba: limit the read size
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Thu Feb 17 06:55:21 UTC 2022
Jean-Baptiste Kempf pushed to branch 3.0.x at VideoLAN / VLC
Commits:
58aba0bc by Thomas Guillem at 2022-02-17T06:38:27+00:00
samba: limit the read size
Fixes #22909
(cherry picked from commit abf527b59d632db06fae67b1322890c273a241c6)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
- - - - -
1 changed file:
- modules/access/smb.c
Changes:
=====================================
modules/access/smb.c
=====================================
@@ -323,6 +323,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 )
{
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/58aba0bc595d1119154a6a8295eac38fecc62a1d
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/58aba0bc595d1119154a6a8295eac38fecc62a1d
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list