-
- Downloads
Fix error creating a merge request when diff includes a null byte
If a diff happened to include a single null byte anywhere, insertion into the database would fail with an Error 500 since the column is text and not a byte array. To fix this, we mark the diff as binary if we detect a single null byte and Base64-encode it. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/57710
Showing
- app/models/merge_request_diff.rb 6 additions, 1 deletionapp/models/merge_request_diff.rb
- changelogs/unreleased/sh-handle-null-bytes-in-merge-request-diffs.yml 5 additions, 0 deletions...nreleased/sh-handle-null-bytes-in-merge-request-diffs.yml
- spec/models/merge_request_diff_spec.rb 21 additions, 0 deletionsspec/models/merge_request_diff_spec.rb
- spec/support/helpers/repo_helpers.rb 14 additions, 0 deletionsspec/support/helpers/repo_helpers.rb
Please register or sign in to comment