DtSvc: Fixes a segfault on Debian squeeze 64 bit and most probably other systems...
authorJon Trulson <jon@radscan.com>
Wed, 8 Aug 2012 18:45:40 +0000 (12:45 -0600)
committerJon Trulson <jon@radscan.com>
Wed, 8 Aug 2012 18:45:40 +0000 (12:45 -0600)
Patch from Marc Balmer <marc@msys.ch>:

Use strlen, not sizeof, here.  Fixes a segfault on Debian squeeze 64 bit
and most probably other systems, too.

cde/lib/DtSvc/DtUtil1/DtsMM.c

index e59bc5ee45753b29555aefa28cdd88545d2c09fa..d9d745f191ad8587612570f395e62e17060819df 100644 (file)
@@ -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,