Forwarded from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=343552
From: Stephen van Egmond <sva...@ha...>
To: Debian Bug Tracking System <su...@bu...>
Subject: sqlrelay: segfaults when history file isn't writable
Date: Thu, 15 Dec 2005 19:27:32 -0500
Package: sqlrelay
Version: 1:0.35-10
Severity: minor
I was experimenting with sqlrelay as root, and then switched to my user
account. The .sqlrsh_history file was chown 400 root.
The problem is this passage in src/cmdline/sqlrsh.C:
// create the history file if it doesn't exist now
FILE *historyfile=fopen(filename,"a");
fclose(historyfile);
read_history(filename);
Wrapping fclose() and read_history() with
if (historyfile) {
}
should suffice.
--
Renat Sabitov e-mail: sr...@st...
Stack Soft jid: sr...@ja...
|