diff options
author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-03-19 01:40:01 +0000 |
---|---|---|
committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-03-19 01:40:01 +0000 |
commit | ace25983a48768adad2713435b634c326f078a9e (patch) | |
tree | 6af6cdf81c67e303c6b283c4b9941d1312768aa3 /src | |
parent | bb7b8e27ee1c32c79b99268f257ae32a28ea87cf (diff) |
Fixed bug #1143 - Fixed a blind sprintf in sighandler that would write an error message to unallocated memory
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2821 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c index 5996dcf4f..2fa3a8f21 100644 --- a/src/main.c +++ b/src/main.c @@ -331,7 +331,7 @@ void sighandler(int signum) * always set when we need it. It seems some signals slip through to the * QUIT code without having a valid quitmsg. -GD */ - quitmsg = sstrdup("Signal Received"); + quitmsg = "Signal Received"; if (started) { #ifndef _WIN32 if (signum == SIGHUP) { /* SIGHUP = save databases and restart */ @@ -362,8 +362,8 @@ void sighandler(int signum) save_databases(); if (!read_config(1)) { - sprintf(quitmsg, - "Error Reading Configuration File (Received SIGUSR2)"); + static char *buf = "Error Reading Configuration File (Received SIGUSR2)"; + quitmsg = buf; quitting = 1; } send_event(EVENT_RELOAD, 1, EVENT_START); |