From: Jeff Halter Date: Thu, 23 Jun 2022 23:04:10 +0000 (-0700) Subject: Fix panic when commenting file without existing info fork X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/commitdiff_plain/a1ac9a6f60c6881bb9fe97425f6aaa524b910035?ds=inline;hp=-c Fix panic when commenting file without existing info fork --- a1ac9a6f60c6881bb9fe97425f6aaa524b910035 diff --git a/hotline/flattened_file_object.go b/hotline/flattened_file_object.go index 6ccd9d7..63a189a 100644 --- a/hotline/flattened_file_object.go +++ b/hotline/flattened_file_object.go @@ -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)))