Skip to contentSkip to conversation

python/xc: fix out of bounds array access

PATCH New Jan Beulich 1 participant 1 message Jun 15, 2010 Arm/actions semi architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 python/xc: fix out of bounds array access

Writing a NUL terminator here isn't even necessary, since snprintf() already guarantees proper termination.

tools/python/xen/lowlevel/xc/xc.c +0 -1
@@ -58,7 +58,6 @@ static PyObject *pyxc_error_to_exception
         snprintf(err_buf.message, sizeof(err_buf.message),
                  "xc_interface_open failed: %s",
                  strerror(errno));
-        err_buf.message[sizeof(err_buf)-1] = 0;
         err_buf.code = XC_INTERNAL_ERROR;
         err = &err_buf;
     }

Writing a NUL terminator here isn't even necessary, since snprintf() already guarantees proper termination.

tools/python/xen/lowlevel/xc/xc.c +0 -1
@@ -58,7 +58,6 @@ static PyObject *pyxc_error_to_exception
         snprintf(err_buf.message, sizeof(err_buf.message),
                  "xc_interface_open failed: %s",
                  strerror(errno));
-        err_buf.message[sizeof(err_buf)-1] = 0;
         err_buf.code = XC_INTERNAL_ERROR;
         err = &err_buf;
     }

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel