----- Forwarded message from Peter Wang <email@example.com.
(posted to scsh-news)
Hello, I'm not sure what to make of this. scsh segfaults if I ask the
SUnet web server for particularly-named files.
Here's the output from the server:
# ./start-web-server -h /var/www -c /var/www/cgi-bin -p 8000 -l
zsh: segmentation fault ./start-web-server-via-image -h /var/www -c
/var/www/cgi-bin -p 8000 -l
Here's the request:
$ wget 'http://localhost:8000/1 Last Show'
----- End forwarded message -----
I tracked this error down to the syslog facility. The problem is that
the syslog function seems not to escape the percent signs in the
syslog message. According to the man page the syslog message
string is formatted like a printf(3) string. On my Linux system the string
`1%20Last%20Show' contains a pointer to an array that is of course
not present and thus causes a segfault while calling syslog(3).
A solution may be to escape the message string before sending it
through the FFI (e.g. in scsh/syslog.scm)
The attached file contains a small scsh script that causes the scshvm
to segfault on both Linux and FreeBSD.