Attached a patch.

The only problem is I don't free(tmp) but I guess it's not a big issue

-- 
GPG-Key: 0xA3FD0DF7 - 9F73 032E EAC9 F7AD 951F  280E CB66 8E29 A3FD 0DF7
Debian User and Developer.
Homepage: www.foolab.org
diff -Naur acon-1.0.5.orig/acon.c acon-1.0.5/acon.c
--- acon-1.0.5.orig/acon.c	2003-07-18 22:09:06.000000000 +0300
+++ acon-1.0.5/acon.c	2008-04-13 18:36:55.000000000 +0300
@@ -46,13 +46,24 @@
 		char *env;
 		FILE *fp;
 		char font[300],translation[300],keymap[300];
-		char tmp[300];
+		char *tmp = NULL;
 
 		font[0]=translation[0]=keymap[0]=0;
-		if((env=getenv("HOME")))
-			sprintf(tmp,"%s/.acon.conf",env);
-		else
-			strcpy(tmp,"/etc/acon.conf");
+		if((env=getenv("HOME"))) {
+		  tmp = malloc(strlen(env) + 12);
+		  if (!tmp) {
+		    perror("malloc");
+		    return 1;
+		  }
+		  sprintf(tmp,"%s/.acon.conf",env);
+		}
+		else {
+		  tmp = strdup("/etc/acon.conf");
+		  if (!tmp) {
+		    perror("strdup");
+		    return 1;
+		  }
+		}
 		if((fp=fopen(tmp,"r"))==NULL)
 		{
 			if((fp=fopen("/etc/acon.conf","r"))==NULL)

Attachment: signature.asc
Description: Digital signature

Reply via email to