소스 검색

Avoid array out of bound error.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2529 fd59a12c-fef9-0310-b244-a6a79926bd2f
Angus Salkeld 16 년 전
부모
커밋
494bf45ebf
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;
 }