Skip to content

Commit

Permalink
Merge pull request #2187 from openSUSE/release-1.14-oob-log-fix
Browse files Browse the repository at this point in the history
[1.14] Fix possible out of bounds access during log parsing
  • Loading branch information
k8s-ci-robot committed Mar 29, 2019
2 parents cb25601 + b58326d commit efb108a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion oci/runtime_oci.go
Expand Up @@ -248,7 +248,7 @@ func parseLog(log []byte) (stdout, stderr []byte) {
linetype := string(parts[2])
if linetype == "P" {
contentLen := len(content)
if content[contentLen-1] == '\n' {
if contentLen > 0 && content[contentLen-1] == '\n' {
content = content[:contentLen-1]
}
}
Expand Down

0 comments on commit efb108a

Please sign in to comment.