Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
database/sql: clone data for named []byte types
Previously named byte types like json.RawMessage could get dirty database memory from a call to Scan. These types would activate a code path that didn't clone the byte data coming from the database before assigning it. Another thread could then overwrite the byte array in src, which has unexpected consequences. Originally reported by Jason Moiron; the patch and test are his suggestions. Fixes #13905. Change-Id: Iacfef61cbc9dd51c8fccef9b2b9d9544c77dd0e0 Reviewed-on: https://go-review.googlesource.com/22393 Reviewed-by: Brad Fitzpatrick <[email protected]>
- Loading branch information