The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Archive for November 25th, 2025

When compiler optimisations cause memcpy undefined behaviour: Fix a crash trying to save an empty AudioStream by hpvb · Pull Request #100422 · godotengine/godot · GitHub

Posted by jpluimers on 2025/11/25

The libc C standard library memcpy function is very fast, but because of that also very dumb and with a list of circumstances where its behaviour is undefined (a great opportunity to introduce vulnerabilities in your code). The specs of those are in [Wayback/Archive] memcpy, memcpy_s – cppreference.com, including:

The behavior is undefined if either dest or src is an invalid or null pointer.

With C compilers becoming smarter and smarter, their optimisations can hide the fact that you call memcpy with parameters causing undefined behaviour.

This is a nice example of that: [Wayback/Archive] Fix a crash trying to save an empty AudioStream by hpvb · Pull Request #100422 · godotengine/godot · GitHub

The change is relatively simple, but hardly shows why the change is there. Only one line got changed in [Wayback/Archive] Fix a crash trying to save an empty AudioStream by hpvb · Pull Request #100422 · godotengine/godot · GitHub

Read the rest of this entry »

Posted in C, Development, Software Development | Tagged: , , | Leave a Comment »

Online x86 and x64 Intel Instruction Assembler

Posted by jpluimers on 2025/11/25

[Wayback/Archive] Online x86 and x64 Intel Instruction Assembler

The source starts in these two files:

Read the rest of this entry »

Posted in Assembly Language, Conference Topics, Conferences, Development, Event, Software Development, x64, x86 | Leave a Comment »