[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#410466: Stupid lp64 bug - undeclared func returns int and sizeof (int) < sizeof (char*)



Bug 410466 happens on lp64 platforms (e.g. "amd64").

Code is:

181         snprintf(id, sizeof(id), "%d.%d.%d.%s", (int) getuid(),
(int) getpid(), (int) time(0), getmyname());

But "getmyname()" is not defined, so defaults to returning int.

However sizeof (char*) > sizeof (int) so 32 bits of the address are
thrown away.

Bang.

Q&D fix:

--- splitmail.c.orig    2007-03-27 14:26:07.000000000 +0200
+++ splitmail.c 2007-03-27 14:42:16.000000000 +0200
@@ -25,6 +25,7 @@
 #define MINCHUNKSIZE 20000 /* Better be enough to hold the headers, or
we die! */

 extern char *getenv();
+extern char *getmyname();
 #define NORMALDELIVERYCMD "/usr/sbin/sendmail -t -oi"
 #define VERBOSEDELIVERYCMD "/usr/sbin/sendmail -t -v -oi"






Reply to: