russellhaering / goxmldsig

Pure Go implementation of XML Digital Signatures
Apache License 2.0
154 stars 127 forks source link

Fix deletion of attributes in-place #79

Closed jupenur closed 2 years ago

jupenur commented 2 years ago

We were calling RemoveAttr while ranging the slice which would call a = append(a[:i], a[i+1:]...). This incorrectly changes the array contents while the slice range variable remains the same and therefore incorrectly deleting the wrong attribute.

We fix this by properly implementing a slice filter in-place.