Skip to content

Conversation

@embg
Copy link
Contributor

@embg embg commented Jul 29, 2022

Edit: commit e1873ad fixes the buffer underflow, but I realized there is a deeper issue here. The current behavior for --output-dir-flat="" and --output-dir-mirror="" maps "" -> "/". This is bad. Therefore, in f9f27de, I disallow empty string as an argument for those flags (and add a test verifying that behavior).

@embg embg changed the title Fix buffer underflow for null dir1 Fix buffer underflow for dir1 == "" Jul 29, 2022
@terrelln
Copy link
Contributor

Please add a test case to the cli-tests https://github.com/facebook/zstd/tree/dev/tests/cli-tests/basic

@terrelln
Copy link
Contributor

LGTM once you have a test case

@embg embg changed the title Fix buffer underflow for dir1 == "" Disallow empty string as argument for --output-dir-flat and --output-dir-mirror Jul 30, 2022
@embg
Copy link
Contributor Author

embg commented Jul 30, 2022

LGTM once you have a test case

Added a test and disallowed empty string as an argument for --output-dir-flat and --output-dir-mirror.

@embg embg merged commit 28ceb63 into facebook:dev Aug 1, 2022
@embg embg deleted the issue3200 branch August 1, 2022 18:05
@Cyan4973 Cyan4973 mentioned this pull request Feb 9, 2023
brainhoard-github pushed a commit to distro-core-curated-mirrors/poky-contrib that referenced this pull request Nov 4, 2024
Pick commits from [1] linked from [2] via [3].

[1] facebook/zstd#3220
[2] https://nvd.nist.gov/vuln/detail/CVE-2022-4899
[3] facebook/zstd#3200

(From OE-Core rev: 2573beba23b0b7250e7280002029f6c34f6bd100)

Signed-off-by: Peter Marko <[email protected]>
Signed-off-by: Steve Sakoman <[email protected]>
brainhoard-github pushed a commit to distro-core-curated-mirrors/poky-contrib that referenced this pull request Nov 5, 2024
Pick commits from [1] linked from [2] via [3].

[1] facebook/zstd#3220
[2] https://nvd.nist.gov/vuln/detail/CVE-2022-4899
[3] facebook/zstd#3200

(From OE-Core rev: 2573beba23b0b7250e7280002029f6c34f6bd100)

Signed-off-by: Peter Marko <[email protected]>
Signed-off-by: Steve Sakoman <[email protected]>
brainhoard-github pushed a commit to distro-core-curated-mirrors/poky-contrib that referenced this pull request Nov 6, 2024
Pick commits from [1] linked from [2] via [3].

[1] facebook/zstd#3220
[2] https://nvd.nist.gov/vuln/detail/CVE-2022-4899
[3] facebook/zstd#3200

(From OE-Core rev: eb9c9818088105f9bf20b7fdc04a380ce488a5e6)

Signed-off-by: Peter Marko <[email protected]>
Signed-off-by: Steve Sakoman <[email protected]>
brainhoard-github pushed a commit to distro-core-curated-mirrors/poky-contrib that referenced this pull request Nov 6, 2024
Pick commits from [1] linked from [2] via [3].

[1] facebook/zstd#3220
[2] https://nvd.nist.gov/vuln/detail/CVE-2022-4899
[3] facebook/zstd#3200

(From OE-Core rev: eb9c9818088105f9bf20b7fdc04a380ce488a5e6)

Signed-off-by: Peter Marko <[email protected]>
Signed-off-by: Steve Sakoman <[email protected]>
brainhoard-github pushed a commit to distro-core-curated-mirrors/poky-contrib that referenced this pull request Nov 7, 2024
Pick commits from [1] linked from [2] via [3].

[1] facebook/zstd#3220
[2] https://nvd.nist.gov/vuln/detail/CVE-2022-4899
[3] facebook/zstd#3200

(From OE-Core rev: eb9c9818088105f9bf20b7fdc04a380ce488a5e6)

Signed-off-by: Peter Marko <[email protected]>
Signed-off-by: Steve Sakoman <[email protected]>
brainhoard-github pushed a commit to distro-core-curated-mirrors/poky-contrib that referenced this pull request Nov 8, 2024
Pick commits from [1] linked from [2] via [3].

[1] facebook/zstd#3220
[2] https://nvd.nist.gov/vuln/detail/CVE-2022-4899
[3] facebook/zstd#3200

(From OE-Core rev: eb9c9818088105f9bf20b7fdc04a380ce488a5e6)

Signed-off-by: Peter Marko <[email protected]>
Signed-off-by: Steve Sakoman <[email protected]>
halstead pushed a commit to openembedded/openembedded-core that referenced this pull request Nov 11, 2024
Pick commits from [1] linked from [2] via [3].

[1] facebook/zstd#3220
[2] https://nvd.nist.gov/vuln/detail/CVE-2022-4899
[3] facebook/zstd#3200

Signed-off-by: Peter Marko <[email protected]>
Signed-off-by: Steve Sakoman <[email protected]>
halstead pushed a commit to yoctoproject/poky that referenced this pull request Nov 11, 2024
Pick commits from [1] linked from [2] via [3].

[1] facebook/zstd#3220
[2] https://nvd.nist.gov/vuln/detail/CVE-2022-4899
[3] facebook/zstd#3200

(From OE-Core rev: eb9c9818088105f9bf20b7fdc04a380ce488a5e6)

Signed-off-by: Peter Marko <[email protected]>
Signed-off-by: Steve Sakoman <[email protected]>
jpuhlman pushed a commit to MontaVista-OpenSourceTechnology/poky that referenced this pull request Nov 12, 2024
Source: poky
MR: 170427
Type: Integration
Disposition: Merged from poky
ChangeID: 2496178
Description:

Pick commits from [1] linked from [2] via [3].

[1] facebook/zstd#3220
[2] https://nvd.nist.gov/vuln/detail/CVE-2022-4899
[3] facebook/zstd#3200

(From OE-Core rev: eb9c9818088105f9bf20b7fdc04a380ce488a5e6)

Signed-off-by: Peter Marko <[email protected]>
Signed-off-by: Steve Sakoman <[email protected]>
Signed-off-by: Jeremy A. Puhlman <[email protected]>
cd-fge added a commit to cd-fge/advisory-database that referenced this pull request Nov 7, 2025
The referenced vulnerability affects the zstd command line tool only.

The fix in zstd touches files in programs/, none in lib/:
facebook/zstd#3220
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Buffer overrun can happen in util.c

3 participants