Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"error: corrupt patch at line 124 "when I applying a patch to the build system,an error occured. #7

Open
ddwupup opened this issue Oct 5, 2020 · 9 comments

Comments

@ddwupup
Copy link

ddwupup commented Oct 5, 2020

$ git apply optee_fuzzer/patches/optee-3.3/build.diff
optee_fuzzer/patches/optee-3.3/build.diff:37: trailing whitespace.
echo "slink /lib/libsqlfs.so libsqlfs.so.1 755 0 0" >> $(fl); \
error: corrupt patch at line 124

why this problem occured and how can I solve it,please?

@c01dkit
Copy link

c01dkit commented Aug 11, 2021

@ddwupup

You can add \ No newline at end of file at line 125( the tail of the file)

And, remove the extra whitespace at line 37

Then run git apply --ignore-space-change --ignore-whitespace ../afl-tee/patches/optee-3.3/build.diff in the "build" folder

@bitwave
Copy link

bitwave commented Nov 11, 2021

same happens for me with the other patches...
Can these be updated or the patch base (agains which I can apply them) be specified? I used -b 3.3.0 for repo checkout

@Resery
Copy link

Resery commented Dec 27, 2021

are u solved this problem ? i can't patch the optee_client and optee_os

@ddwupup
Copy link
Author

ddwupup commented Dec 27, 2021

@ddwupup

You can add \ No newline at end of file at line 125( the tail of the file)

And, remove the extra whitespace at line 37

Then run git apply --ignore-space-change --ignore-whitespace ../afl-tee/patches/optee-3.3/build.diff in the "build" folder

Thank you, I solved it by manually patch the fixed files according to the diffing files.

@ddwupup
Copy link
Author

ddwupup commented Dec 27, 2021

are u solved this problem ? i can't patch the optee_client and optee_os

You can try this way https://github.com/Riscure/optee_fuzzer/issues/7#issuecomment-896778249 If it doesn't work, you can try to patch the fixed files according to the diffing files, then complies the programs and debug. Good luck!

@Resery
Copy link

Resery commented Dec 27, 2021

are u solved this problem ? i can't patch the optee_client and optee_os

You can try this way #7 (comment) If it doesn't work, you can try to patch the fixed files according to the diffing files, then complies the programs and debug. Good luck!

i tired i can patch the build but it doesn't working for optee_os and optee_client
This is the erroe message: error: corrupt patch at line xxx

@bitwave
Copy link

bitwave commented Jan 20, 2022

For the optee_client.diff patch this command works git apply --recount --ignore-space-change --ignore-whitespace ../afl-tee/patches/optee-3.3/optee_client.diff it ignores the line counts in the patch headers, which are wrong.

@bitwave
Copy link

bitwave commented Jan 20, 2022

for optee_os.diff remove the line 1264. In the file to be patched, there is not an empty line. Therefore the patch fails. These with git apply --ignore-space-change --ignore-whitespace for the build patch, as mentioned earlier to apply all patches.

@coderCK2
Copy link

For the optee_client.diff patch this command works git apply --recount --ignore-space-change --ignore-whitespace ../afl-tee/patches/optee-3.3/optee_client.diff it ignores the line counts in the patch headers, which are wrong.

Thank you for this. It was the combo of --recount and --ignore-space-change that got my particular issue resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants