]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix for FSCORE-78. Write whole buffer of the pid into file with padded NULL's so...
authorMichael Jerris <mike@jerris.com>
Tue, 25 Dec 2007 03:00:29 +0000 (03:00 +0000)
committerMichael Jerris <mike@jerris.com>
Tue, 25 Dec 2007 03:00:29 +0000 (03:00 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6977 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch.c

index a8f07af0c1e94ae2428b21ab0e7d09e9e82b7c78..087f7c862661858c9d165471f0d15b10e97c73d2 100644 (file)
@@ -443,9 +443,10 @@ int main(int argc, char *argv[])
 
        pid = getpid();
 
+       memset(pid_buffer, 0, sizeof(pid_buffer));
        switch_snprintf(pid_path, sizeof(pid_path), "%s%s%s", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR, pfile);
        switch_snprintf(pid_buffer, sizeof(pid_buffer), "%d", pid);
-       pid_len = strlen(pid_buffer);
+       pid_len = sizeof(pid_buffer);
 
        apr_pool_create(&pool, NULL);
     if (switch_file_open(&fd,