sassoftware / relic

Relic is a service and a tool for adding digital signatures to operating system packages for Linux and Windows
Apache License 2.0
151 stars 41 forks source link

comdoc writeat: negative offset #29

Closed gabriel-vasile closed 1 year ago

gabriel-vasile commented 1 year ago

I'm not sure if this a bug in library code or a problem with the file that I used for test.

package main

import (
    "fmt"

    "github.com/sassoftware/relic/v7/lib/comdoc"
)

func main() {
    doc, err := comdoc.WritePath("xls.xls")
    if err != nil {
        fmt.Println(err)
    }

    if err := doc.AddFile("filename", []byte{1, 2, 3}); err != nil {
        fmt.Println(err)
    }
}

expected: doc.AddFile returns nil what happened: doc.AddFile returns writeat xls.xls: negative offset

xls.xls

mtharp commented 1 year ago

relic's comdoc package really only supports MSI files, and even then just the bare minimum to store and validate signatures. I'm happy to accept pull requests if they don't interfere with the main functionality but unfortunately I don't have time to chase down issues myself, sorry!