[PATCH v2 14/25] [libx11] Fixed the handling of the extremely unlikely situation of fstat failing
Alan Coopersmith
alan.coopersmith at oracle.com
Mon Jan 31 23:52:23 PST 2011
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 <ander.conselvan-de-oliveira at nokia.com>
> Signed-off-by: Erkki Seppälä <erkki.seppala at vincit.fi>
> ---
> 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 <alan.coopersmith at oracle.com>
--
-Alan Coopersmith- alan.coopersmith at oracle.com
Oracle Solaris Platform Engineering: X Window System
More information about the xorg-devel
mailing list