mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-09 21:21:14 +00:00
runtime.RawExtension must copy the buffer, not use it
This commit is contained in:
@@ -17,11 +17,16 @@ limitations under the License.
|
||||
package runtime
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"gopkg.in/v1/yaml"
|
||||
)
|
||||
|
||||
func (re *RawExtension) UnmarshalJSON(in []byte) error {
|
||||
re.RawJSON = in
|
||||
if re == nil {
|
||||
return errors.New("runtime.RawExtension: UnmarshalJSON on nil pointer")
|
||||
}
|
||||
re.RawJSON = append(re.RawJSON[0:0], in...)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user