diff --git a/src/kpatch_process.c b/src/kpatch_process.c index a31f70c4ce240acad72274fe786c89685f5b8074..e3cddc1b9b7e09ecadab17efda39170b9f79c671 100644 --- a/src/kpatch_process.c +++ b/src/kpatch_process.c @@ -926,7 +926,7 @@ process_get_comm(kpatch_process_t *proc) ret = readlink(path, realpath, sizeof(realpath)); if (ret < 0) return -1; - realpath[ret - 1] = '\0'; + realpath[ret] = '\0'; bn = basename(realpath); strncpy(path, bn, sizeof(path) - 1); if ((c = strstr(path, " (deleted)")))