+Sat Dec 1 10:22:34 EST 2007 Daniel P. Berrange <berrange@redhat.com>
+
+ * src/qemu_driver.c: Fix off-by-1 buffer NULL termination in
+ symlink comparison code
+
Fri Nov 30 17:50:34 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* src/xml.c, src/xml.h: Disable xen specific functions if
char *p;
strncpy(dir, checkLink, PATH_MAX);
- dir[PATH_MAX] = '\0';
+ dir[PATH_MAX-1] = '\0';
if (!(p = strrchr(dir, '/'))) {
qemudLog(QEMUD_WARN, "Symlink path '%s' is not absolute", checkLink);
}
strncpy(dest, tmp, PATH_MAX);
- dest[PATH_MAX] = '\0';
+ dest[PATH_MAX-1] = '\0';
}
/* canonicalize both paths */
qemudLog(QEMUD_WARN, "Failed to expand path '%s' :%s",
dest, strerror(errno));
strncpy(real, dest, PATH_MAX);
- real[PATH_MAX] = '\0';
+ real[PATH_MAX-1] = '\0';
}
if (!realpath(checkDest, checkReal)) {
qemudLog(QEMUD_WARN, "Failed to expand path '%s' :%s",
checkDest, strerror(errno));
strncpy(checkReal, checkDest, PATH_MAX);
- checkReal[PATH_MAX] = '\0';
+ checkReal[PATH_MAX-1] = '\0';
}
/* compare */