Message ID | 20190103085638.17600-5-philmd@redhat.com |
---|---|
State | New |
Headers | show |
Series | Fix strncpy() warnings for GCC8 new -Wstringop-truncation | expand |
diff --git a/migration/global_state.c b/migration/global_state.c index 8e8ab5c51e..01805c567a 100644 --- a/migration/global_state.c +++ b/migration/global_state.c @@ -42,6 +42,7 @@ int global_state_store(void) void global_state_store_running(void) { const char *state = RunState_str(RUN_STATE_RUNNING); + assert(strlen(state) < sizeof(global_state.runstate)); strncpy((char *)global_state.runstate, state, sizeof(global_state.runstate)); }