[host] app: fix possible string overflow

This commit is contained in:
Geoffrey McRae 2021-01-27 01:28:29 +11:00
parent e2e49bce13
commit 1808adc2de

View File

@ -467,7 +467,7 @@ int app_main(int argc, char * argv[])
.magic = KVMFR_MAGIC, .magic = KVMFR_MAGIC,
.version = KVMFR_VERSION, .version = KVMFR_VERSION,
}; };
strncpy(udata.hostver, BUILD_VERSION, sizeof(udata.hostver)); strncpy(udata.hostver, BUILD_VERSION, sizeof(udata.hostver)-1);
LGMP_STATUS status; LGMP_STATUS status;
if ((status = lgmpHostInit(shmDev.mem, shmDev.size, &app.lgmp, if ((status = lgmpHostInit(shmDev.mem, shmDev.size, &app.lgmp,