Skip to content

Fix error creating a merge request when diff includes a null byte

Stan Hu requested to merge sh-handle-null-bytes-in-merge-request-diffs into master

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.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/57710

Edited by Stan Hu

Merge request reports