diff options
Diffstat (limited to 'xen_4.14.0_fixes.patch')
-rw-r--r-- | xen_4.14.0_fixes.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/xen_4.14.0_fixes.patch b/xen_4.14.0_fixes.patch new file mode 100644 index 000000000000..db0916f42298 --- /dev/null +++ b/xen_4.14.0_fixes.patch @@ -0,0 +1,34 @@ +diff -Naur orig/tools/libxl/libxlu_pci.c patched/tools/libxl/libxlu_pci.c +--- orig/tools/libxl/libxlu_pci.c 2020-07-23 08:07:51.000000000 -0700 ++++ patched/tools/libxl/libxlu_pci.c 2020-07-29 14:40:08.956666630 -0700 +@@ -50,6 +50,7 @@ + unsigned state = STATE_DOMAIN; + unsigned dom, bus, dev, func, vslot = 0; + char *buf2, *tok, *ptr, *end, *optkey = NULL; ++ dom = bus = dev = func = 0; + + if ( NULL == (buf2 = ptr = strdup(str)) ) + return ERROR_NOMEM; +diff -Naur orig/tools/libxl/libxl_utils.c patched/tools/libxl/libxl_utils.c +--- orig/tools/libxl/libxl_utils.c 2020-07-23 08:07:51.000000000 -0700 ++++ patched/tools/libxl/libxl_utils.c 2020-07-29 14:40:08.956666630 -0700 +@@ -1252,14 +1252,16 @@ + struct sockaddr_un *un, const char *path, + const char *what) + { +- if (sizeof(un->sun_path) <= strlen(path)) { ++ size_t len = strlen(path); ++ ++ if (sizeof(un->sun_path) <= len) { + LOG(ERROR, "UNIX socket path '%s' is too long for %s", path, what); +- LOG(DEBUG, "Path must be less than %zu bytes", sizeof(un->sun_path)); ++ LOG(DEBUG, "Path of len %zu must be less than %zu bytes", len, sizeof(un->sun_path)); + return ERROR_INVAL; + } + memset(un, 0, sizeof(struct sockaddr_un)); + un->sun_family = AF_UNIX; +- strncpy(un->sun_path, path, sizeof(un->sun_path)); ++ memcpy(un->sun_path, path, len); + return 0; + } + |