[MSHADE-417] Fix null bytes appended to small files by maven-shade-plugin (original) (raw)

Log inSkip to main contentSkip to sidebar

ASF Jira

Public signup for this instance is disabled. Go to our Self serve sign up page to request an account. Report potential security issues privately

Uploaded image for project: 'Maven Shade Plugin (Moved to GitHub Issues)'

  1. Maven Shade Plugin (Moved to GitHub Issues)
  2. MSHADE-417

Log In

Export

XMLWordPrintableJSON

Details

Description

Version 3.3.0 of maven shade plugin seems to append "\x00" bytes to a file if it's less than 4 bytes:

$ echo -n a > src/main/resources/test.txt $ mvn clean install ... $ bsdtar -xOf target/original-shadetest-0.0.0.jar test.txt | xxd 00000000: 61 a $ bsdtar -xOf target/shadetest-0.0.0.jar test.txt | xxd 00000000: 6100 0000 a...

I've attached a basic pom.xml that triggers this. This doesn't occur in the previous version, 3.2.4.

Attachments

Attachments

  1. original-shadetest-0.0.0.jar
    31/Mar/22 09:32
    2 kB
    Max Zerzouri
  2. pom.xml
    31/Mar/22 02:34
    1.0 kB
    Max Zerzouri
  3. shadetest-0.0.0.jar
    31/Mar/22 09:32
    2 kB
    Max Zerzouri
  4. test.txt
    31/Mar/22 09:37
    0.0 kB
    Max Zerzouri

is broken by

Bug - A problem which impairs or prevents the functions of the product. MSHADE-378 Shade plugin changes the compression level of nested jar entries

links to

Web Link GitHub Pull Request #140

Web Link GitHub Pull Request #160

Activity

People

Assignee:

gnodet Guillaume Nodet

Reporter:

max.zerzouri.solnet Max Zerzouri

Votes:

3 Vote for this issue

Watchers:

6 Start watching this issue

Dates

Created:

31/Mar/22 02:33

Updated:

14/Jun/25 18:13

Resolved:

20/Oct/22 20:36