From: Jon Trulson Date: Wed, 8 Aug 2012 18:45:40 +0000 (-0600) Subject: DtSvc: Fixes a segfault on Debian squeeze 64 bit and most probably other systems... X-Git-Tag: 2.2.0b~89 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=facb50dfde50d087a7c72ae5da0e080a208625ff;p=oweals%2Fcde.git DtSvc: Fixes a segfault on Debian squeeze 64 bit and most probably other systems, too. Patch from Marc Balmer : Use strlen, not sizeof, here. Fixes a segfault on Debian squeeze 64 bit and most probably other systems, too. --- diff --git a/cde/lib/DtSvc/DtUtil1/DtsMM.c b/cde/lib/DtSvc/DtUtil1/DtsMM.c index e59bc5ee..d9d745f1 100644 --- a/cde/lib/DtSvc/DtUtil1/DtsMM.c +++ b/cde/lib/DtSvc/DtUtil1/DtsMM.c @@ -568,8 +568,8 @@ _DtDtsMMCacheName(int override) /* unique file name instead. */ char tmpnam_buf[L_tmpnam + 1]; - results = (char *)malloc(sizeof(_DTDTSMMTEMPDIR) + - sizeof(_DTDTSMMTEMPFILE) + + results = (char *)malloc(strlen(_DTDTSMMTEMPDIR) + + strlen(_DTDTSMMTEMPFILE) + L_tmpnam + 3); tmpnam(tmpnam_buf); sprintf(results, "%s/%s%s", _DTDTSMMTEMPDIR, _DTDTSMMTEMPFILE,