Fix segfault in 2006/birken under macOS

The problem was a missing +1 for strlen() in a malloc() call.

This entry still uses gets() and strangely changing it to fgets() makes
it segfault but I'll worry about this later when more entries have been
checked and (if possible) fixed.
This commit is contained in:
Cody Boone Ferguson committed 2023-03-24 10:40:12 -07:00
1 parent dea5b4d5f1
commit 0c07302777
2 files changed
+5 -1

No files matched your search

+4
View File
@@ -18,6 +18,10 @@ make
./birken < file.tofu
```
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed a segfault in
macOS with this entry. The problem was a missing `+1` for strlen() with
malloc(). Thank you Cody for your assistance!
### Try:
```sh
+1 -1
View File
@@ -64,7 +64,7 @@ _=z->o; c=_->o->_; a= c->_->_->o; c=_
->c++; h(c); } Q Z(a->c<c->c){ a
->c++; h(a); } z=z->_; } } X*
v(X*_,int O){ X*s=(X*)m\
alloc(strlen(_)*siz\
alloc(1+strlen(_)*siz\
eof(X)); X*l=s;
J((*l++=*_?
*_-O:0)