Language: Go
Label: safe
CWE: CWE-201 \u2014 Insertion of Sensitive Information Into Sent Data
The code transmits data to another actor, but a portion of the data includes sensitive information that should not be accessible to that actor.

Code:
func Dexif(filepath string, destpath string) error {
	img, err := ioutil.ReadFile(filepath)
	if err != nil {
		return err
	}
	noExifBytes, err := exifremove.Remove(img)
	if err != nil {
		return err
	}
	err = os.WriteFile(destpath, noExifBytes, 0644)
	if err != nil {
		return err
	}
	return nil
}