Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Date: Mon, 10 Jul 2017 14:09:07 +0000
From: Pascal Cuoq <>
To: "" <>
Subject: strlen strict-aliasing-safe GCC version


the attached patch fixes a strict aliasing violation in strlen. The same GCC extension used in this patch is already used in musl's memcpy and memset functions.

In musl's memcpy and memset, the entire optimized version of the function is contained in #ifdef __GNUC__. This patch follows the same approach.

On my x86-64 Ubuntu, strlen.c compiles after the patch is applied and produces the same object file as before.

PS: strlen in its optimized version also makes an out-of-bounds access for some inputs. This is already known:
I do not have a fix for that, but I left a comment in the source code.


Download attachment "strlen_sa.patch" of type "application/octet-stream" (737 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.