mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
Add filename conformity check
* Add util function to check a filename for confirming to csaf-v2.0-csd02. * Add code to reject bad filenames in provider, checker, aggregator and uploader.
This commit is contained in:
parent
f6fa366ee5
commit
17f22855ee
6 changed files with 99 additions and 9 deletions
|
|
@ -277,6 +277,10 @@ func (p *processor) uploadRequest(filename string) (*http.Request, error) {
|
|||
// It prints the response messages.
|
||||
func (p *processor) process(filename string) error {
|
||||
|
||||
if bn := filepath.Base(filename); !util.ConfirmingFileName(bn) {
|
||||
return fmt.Errorf("%q is not a confirming file name", bn)
|
||||
}
|
||||
|
||||
req, err := p.uploadRequest(filename)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue