]> git.r.bdr.sh - rbdr/mobius/commitdiff
Fix panic when commenting file without existing info fork
authorJeff Halter <redacted>
Thu, 23 Jun 2022 23:04:10 +0000 (16:04 -0700)
committerJeff Halter <redacted>
Thu, 23 Jun 2022 23:04:10 +0000 (16:04 -0700)
hotline/flattened_file_object.go

index 6ccd9d7071000e456b2078c5d71414206d422906..63a189a3df88fba06baf1efe1e2ca6e6c9966c66 100644 (file)
@@ -69,6 +69,7 @@ func (ffif *FlatFileInformationFork) friendlyCreator() []byte {
 }
 
 func (ffif *FlatFileInformationFork) setComment(comment []byte) error {
+       ffif.CommentSize = make([]byte, 2)
        ffif.Comment = comment
        binary.BigEndian.PutUint16(ffif.CommentSize, uint16(len(comment)))