Subject: Re: bug#74922: Fwd: bug#74922: 29.4; copy_string_contents doesn't always produce a valid utf-8

From: Eli Zaretskii <[email-masked]>
Date: Tue, 17 Dec 2024 17:10:36 +0200

> From: Evgeny Kurnevsky <[email-masked]>
> Date: Tue, 17 Dec 2024 14:46:28 +0000
> Cc: [email-masked]
> 
> It can definitely do it, but I guess in emacs-module-rs it's not done by default because of performance
> implications - it might be quite costly to check every string in some cases, and it wasn't really clear if emacs
> can pass an invalid string. So currently this case causes undefined behavior there which results in emacs
> crash.

What do Rust programs do when they are told to read random files?
This is the same situation, basically.

And what would the module do if copy_string_contents *did* signal an
error?