[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] libxl: make sure buffer is null-terminated in libxl_read_file_contents [and 3 more messages]
Wei Liu writes ("Re: [Xen-devel] [PATCH] libxl: make sure buffer is null-terminated in libxl_read_file_contents [and 3 more messages]"): > We can safely remove the trailing nul if libxl API makes sure a buffer > is nul-terminated. Old files will still work with new library. New files > won't work with old library -- but we don't support that. I guess. > > I am inclined to think that something along the lines of the original > > patch is the way to do that. Although, this extra nul byte should be > > documented in the API comment then. > > > > Also, we should identify where the additional nul byte is coming > > from. While we can't just delete that, we should put a comment in > > saying that the off-by-one error is deliberate. > > What off-by-one error? The one that writes a nul to the file. I can't believe it was deliberate. I haven't looked to find where it comes from but if the code where it comes from doesn't look like an off-by-one error then it is too obtuse :-). Ian. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |