Handling invalid UTF-8 character in sys info (#2360)

In some operation systems, the sys info contains invalid characters.
In this patch try to keep the original fallback logic but filter out the cases when the character is invalid.
This commit is contained in:
Zoltan Papp
2024-08-01 16:46:55 +02:00
committed by GitHub
parent cbf9f2058e
commit 0c8f8a62c7
5 changed files with 264 additions and 16 deletions

View File

@ -10,7 +10,7 @@ import (
func EncryptMessage(remotePubKey wgtypes.Key, ourPrivateKey wgtypes.Key, message pb.Message) ([]byte, error) {
byteResp, err := pb.Marshal(message)
if err != nil {
log.Errorf("failed marshalling message %v", err)
log.Errorf("failed marshalling message %v, %+v", err, message.String())
return nil, err
}