unifyfs: Fix strncpy build error of version 0.9.1 (#22066)

This commit is contained in:
Tomoyasu Nojiri 2021-03-05 00:46:18 +09:00 committed by GitHub
parent 49c015e391
commit d7dd12edab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View file

@ -54,6 +54,8 @@ class Unifyfs(AutotoolsPackage):
depends_on('gotcha@0.0.2', when='@:0.9.0')
depends_on('leveldb', when='@:0.9.0')
patch('unifyfs-sysio.c.patch', when='@0.9.1')
conflicts('^mercury~bmi')
conflicts('^mercury~sm')
# Known compatibility issues with ifort and xlf. Fixes coming.

View file

@ -0,0 +1,11 @@
--- spack-src/client/src/unifyfs-sysio.c.bak 2020-12-03 09:04:41.197202000 +0900
+++ spack-src/client/src/unifyfs-sysio.c 2021-03-04 10:06:32.626989637 +0900
@@ -245,7 +245,7 @@
* that is big enough */
buf = (char*) malloc(len);
if (buf != NULL) {
- strncpy(buf, unifyfs_cwd, len);
+ memcpy(buf, unifyfs_cwd, strlen(unifyfs_cwd));
} else {
errno = ENOMEM;
}