<feed xmlns='http://www.w3.org/2005/Atom'>
<title>fortify-headers/tests/test_strncpy_static_write.c, branch experimental</title>
<subtitle>Standalone portable header-based implementation of FORTIFY_SOURCE=3 
</subtitle>
<id>http://git.dustri.org/fortify-headers/atom?h=experimental</id>
<link rel='self' href='http://git.dustri.org/fortify-headers/atom?h=experimental'/>
<link rel='alternate' type='text/html' href='http://git.dustri.org/fortify-headers/'/>
<updated>2024-10-10T13:50:40Z</updated>
<entry>
<title>Fix a crash in strncpy/stpncpy</title>
<updated>2024-10-10T13:50:40Z</updated>
<author>
<name>jvoisin</name>
</author>
<published>2024-10-10T13:50:40Z</published>
<link rel='alternate' type='text/html' href='http://git.dustri.org/fortify-headers/commit/?id=e2cfd2879a15db00dfa9a42eeb1baaef6a930aff'/>
<id>urn:sha1:e2cfd2879a15db00dfa9a42eeb1baaef6a930aff</id>
<content type='text'>
```
Core was generated by `scripts/mod/modpost -M -m -o Module.symvers -n -T modules.order vmlinux.o'.
Program terminated with signal SIGSEGV, Segmentation fault.
warning: 17     src/string/strlen.c: No such file or directory
(gdb) bt
```

&gt; I think strncpy logic is broken: `__fh_size_t max_len_s = strlen(__s);` may try read past `size_t __n`.
&gt; Create a buf without any trailing `\0`, do `strncpy(dest, buf, sizeof(buf));`, it should work, since `strncpy` will stop at `sizeof buf`
&gt; but the current fority-headers implementation will do `strlen(buf)`, which will go boom when it is not terminated with \0

Reported-by: ncopa
</content>
</entry>
<entry>
<title>Add tests for strncpy and handle overlapping buffers there</title>
<updated>2023-06-14T12:59:11Z</updated>
<author>
<name>jvoisin</name>
</author>
<published>2023-06-14T12:59:11Z</published>
<link rel='alternate' type='text/html' href='http://git.dustri.org/fortify-headers/commit/?id=cb1ce9e1815a492de0f13c2b046b8472024b9f6d'/>
<id>urn:sha1:cb1ce9e1815a492de0f13c2b046b8472024b9f6d</id>
<content type='text'>
</content>
</entry>
</feed>
