This repository was archived by the owner on Aug 30, 2025. It is now read-only.
This repository was archived by the owner on Aug 30, 2025. It is now read-only.
maxLength is too low and preserveDomain is true #3540
Bug description
Generating a fullname email and preserving the domain with a low
maxLengthvalue causing crash.transformEmailcalculatesmaxNameLengthby substracting the domain length frommaxLength.https://github.com/nucleuscloud/neosync/blob/main/worker/pkg/benthos/transformers/transform_email.go#L326
Then calls
generateNameForEmailif the email type isfullname, passing a negative value asmaxNameLengthifpreserve_domainistrue, and the domain is longer thanmaxLength.https://github.com/nucleuscloud/neosync/blob/main/worker/pkg/benthos/transformers/transform_email.go#L326
Then it crashes trying to generate a random string with negative size.
https://github.com/nucleuscloud/neosync/blob/main/worker/pkg/benthos/transformers/generate_email.go#L217
How to reproduce
preserveDomain: true,maxLength: 11,emailType: 'fullname'anyname@hotmail.comas input.GetRandomCharacterStringwill crash because of a negative value for parametersize.