forked from cue-lang/cue
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cue: fix nil pointer deref in BuildInstances
When building instances, we currently unconditionally try to make and then append a Value to the []Value slice returned, even in cases where the build of an instance fails. Fix that by appending an error Value in cases where the build fails, only appending a non-error Value when the build succeeds. This way we retain the property that len(instances) matches the length of the returned []Value slice. Per the docs, the error value returned is the combined errors of building those instances, or nil if there were no errors. Closes cue-lang#1444 Signed-off-by: Matt Moore <mattmoor@chainguard.dev> Change-Id: I3e5107f67814de5eeeaa8db23040bf200de8fd9e Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/532990 Reviewed-by: Paul Jolly <paul@myitcv.io>
- Loading branch information
Showing
2 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters