Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | bfstd: Fix an OOB string index in xmbrtowc() | Tavian Barnes | 2023-09-06 | 1 | -0/+18 |
| | | | | | | | | | | | | | | | | | | | | | | This bug could be reproduced with something like $ bfs -samefile $'\xFA\xFA' bfs: error: bfs: dstrnescat@src/dstring.c:252: wordesc() result truncated or worse, with -DNDEBUG, $ bfs -samefile $'.....................\xFA\xFA' bfs: error: bfs -samefile $'.....................\xFA\xFA\x00\x55\x53\x45\x52\x3D\x74\x61\x76\x69\x61\x6E\x61\x74\x6F\x72 bfs: error: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bfs: error: No such file or directory. which prints the memory after the end of the string (in this case, the environment variable USER=tavianator). The bug was caused by the line `*i += len`, which was intended to be `*i = len`. But actually, the right behaviour seems to be `*i += 1`. Fixes: 19c96abe0a1ee56cf206fd5e87defb1fd3e0daa5 | ||||
* | alloc: New header for memory allocation utilities | Tavian Barnes | 2023-06-20 | 1 | -11/+2 |
| | |||||
* | tests/bfstd: Use bfs_verify() over explicit abort() | Tavian Barnes | 2023-05-19 | 1 | -14/+5 |
| | |||||
* | Switch from assert() to bfs_assert()/bfs_verify() | Tavian Barnes | 2023-05-18 | 1 | -7/+6 |
| | |||||
* | config: Align after saturating in flex_sizeof() | Tavian Barnes | 2023-05-16 | 1 | -1/+2 |
| | | | | | This ensures that it's legal to call aligned_alloc() with the result, which requires a multiple of the alignment. | ||||
* | config: Saturate on overflow in flex_sizeof() | Tavian Barnes | 2023-05-11 | 1 | -0/+1 |
| | |||||
* | config: Properly align flex_sizeof() | Tavian Barnes | 2023-05-11 | 1 | -0/+13 |
| | |||||
* | Replace license boilerplate with SPDX tags | Tavian Barnes | 2023-01-25 | 1 | -15/+2 |
| | | | | | | | And while I'm at it, remove years from copyright declarations. Link: https://spdx.dev/about/ Link: https://daniel.haxx.se/blog/2023/01/08/copyright-without-years/ | ||||
* | bfstd: New wrappers for dirname()/basename() | Tavian Barnes | 2023-01-19 | 1 | -0/+57 |