소스 검색

r2529 | asalkeld | 2009-10-14 16:05:18 -0700 (Wed, 14 Oct 2009) | 3 lines

Avoid array out of bound error.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/branches/flatiron@2597 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake 16 년 전
부모
커밋
6ba8725bd4
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      exec/coroipcs.c

+ 1 - 1
exec/coroipcs.c

@@ -1457,7 +1457,7 @@ static char * pid_to_name (pid_t pid, char *out_name, size_t name_len)
 
 	/* copy the name */
 	strncpy (out_name, name, name_len);
-	out_name[name_len] = '\0';
+	out_name[name_len - 1] = '\0';
 	return out_name;
 }