From 8bea6ce4920cab0c065bcc6ae1eb0b26fc582ebe Mon Sep 17 00:00:00 2001 From: Janne Blomqvist Date: Sun, 29 May 2011 16:17:17 +0300 Subject: [PATCH] PR 49214 fd_gets should return NULL if nothing was read From-SVN: r174395 --- libgfortran/ChangeLog | 5 +++++ libgfortran/runtime/backtrace.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 1d08da8c3b9..f0e3078e8b3 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,8 @@ +2011-05-29 Janne Blomqvist + + PR libfortran/49214 + * runtime/backtrace.c (fd_gets): Return NULL if nothing was read. + 2011-05-29 Janne Blomqvist PR libfortran/19155 diff --git a/libgfortran/runtime/backtrace.c b/libgfortran/runtime/backtrace.c index dff4466aa56..943332ab615 100644 --- a/libgfortran/runtime/backtrace.c +++ b/libgfortran/runtime/backtrace.c @@ -95,6 +95,8 @@ fd_gets (char *s, int size, int fd) else { s[i] = '\0'; + if (i == 0) + return NULL; break; } } -- 2.30.2