File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -444,10 +444,18 @@ static int copy_box_namespace(const char *src, char *dst)
444444
445445 if (src [bytes_copied ] == '\0' ) {
446446 /* We've reached the end of the box namespace. */
447- break ;
447+ ++ bytes_copied ; /* Include the terminating-null in bytes_copied. */
448+ goto done ;
448449 }
449450 }
450451
452+ /* We did not find a terminating null in the src. The src has been verified
453+ * in vmpu_box_namespace_from_id as being in the box config table. It is a
454+ * programmer error if the namespace in the box config table is not
455+ * null-terminated, so we halt. */
456+ HALT_ERROR (SANITY_CHECK_FAILED , "vmpu: Box namespace missing terminating-null\r\n" );
457+
458+ done :
451459 return bytes_copied ;
452460}
453461
You can’t perform that action at this time.
0 commit comments