26 lines
965 B
Diff
26 lines
965 B
Diff
diff -ruN pmdk/src/examples/libpmem2/unsafe_shutdown/unsafe_shutdown.c pmdk-1.12.1/src/examples/libpmem2/unsafe_shutdown/unsafe_shutdown.c
|
|
--- pmdk/src/examples/libpmem2/unsafe_shutdown/unsafe_shutdown.c 2022-11-17 17:53:30.000000000 +0800
|
|
+++ pmdk-1.12.1/src/examples/libpmem2/unsafe_shutdown/unsafe_shutdown.c 2022-12-04 21:30:57.093856024 +0800
|
|
@@ -636,8 +636,8 @@
|
|
return 1;
|
|
}
|
|
|
|
- struct user_data *data;
|
|
- size_t size;
|
|
+ struct user_data *data = NULL;
|
|
+ size_t size = 0;
|
|
enum pool_state state = pool_access_data(pool, (void **)&data, &size);
|
|
|
|
int ret = 1;
|
|
diff -ruN pmdk/src/examples/librpmem/hello.c pmdk-1.12.1/src/examples/librpmem/hello.c
|
|
--- pmdk/src/examples/librpmem/hello.c 2022-11-17 17:53:30.000000000 +0800
|
|
+++ pmdk-1.12.1/src/examples/librpmem/hello.c 2022-12-04 21:30:57.093856024 +0800
|
|
@@ -41,6 +41,7 @@
|
|
{
|
|
hello->lang = lang;
|
|
strncpy(hello->str, hello_str[hello->lang], STR_SIZE);
|
|
+ hello->str[STR_SIZE-1] = '\0';
|
|
}
|
|
|
|
static void
|