scsh-hackers
[Top] [All Lists]

[Scsh-hackers] [ scsh-Bugs-745444 ] syslog does not escape percent signs

To: noreply@sourceforge.net
Subject: [Scsh-hackers] [ scsh-Bugs-745444 ] syslog does not escape percent signs
From: "SourceForge.net" <noreply@sourceforge.net>
Date: Thu May 29 03:29:05 2003
List-id: Discussion among the implementors <scsh-hackers.lists.sourceforge.net>
Sender: scsh-hackers-admin@lists.sourceforge.net
Bugs item #745444, was opened at 2003-05-29 12:28
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110493&aid=745444&group_id=10493

Category: run-time
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Andreas Bernauer (interp)
Assigned to: Nobody/Anonymous (nobody)
Summary: syslog does not escape percent signs

Initial Comment:
----- Forwarded message from Peter Wang <tjaden@alphalink.com.
au> -----
(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 
/var/log/httpd.log
[...]
   syslogging activated.
  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'
  --02:24:04--  http://localhost:8000/1%20Last%20Show
             => `1%20Last%20Show'
[...]
----- 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.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110493&aid=745444&group_id=10493


<Prev in Thread] Current Thread [Next in Thread>
  • [Scsh-hackers] [ scsh-Bugs-745444 ] syslog does not escape percent signs, SourceForge.net <=