You could shorten the summary to: Handle the extremely unlikely situation of fstat failing
since we hope most patches fix something, it's not always necessary to add in "Fixed the..." when other verbs can work. On 01/31/11 04:02 AM, Erkki Seppälä wrote: > Tracked variable "size" was passed to a negative sink. > > Reviewed-by: Ander Conselvan de Oliveira > <[email protected]> > Signed-off-by: Erkki Seppälä <[email protected]> > --- > src/Xrm.c | 6 ++++++ > 1 files changed, 6 insertions(+), 0 deletions(-) > > diff --git a/src/Xrm.c b/src/Xrm.c > index 3e68c37..fbc8ad2 100644 > --- a/src/Xrm.c > +++ b/src/Xrm.c > @@ -1596,6 +1596,12 @@ ReadInFile(_Xconst char *filename) > */ > GetSizeOfFile(fd, size); > > + /* There might have been a problem trying to stat a file */ > + if (size == -1) { > + close (fd); > + return (char *)NULL; > + } > + > if (!(filebuf = Xmalloc(size + 1))) { /* leave room for '\0' */ > close(fd); > return (char *)NULL; Reviewed-by: Alan Coopersmith <[email protected]> -- -Alan Coopersmith- [email protected] Oracle Solaris Platform Engineering: X Window System _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
