public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* RFA: fix to thinko in make-relative-prefix.c:make_relative_prefix_1
@ 2007-11-14  0:13 Douglas Evans
  2008-02-16  6:17 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Douglas Evans @ 2007-11-14  0:13 UTC (permalink / raw)
  To: gcc-patches

Simple thinko.  Return of NULL from strdup isn't checked.

Ok to check in?

2007-11-13  Doug Evans  <dje@google.com>

        * make-relative-prefix.c (make_relative_prefix_1): Handle NULL
        return from strdup.

Index: make-relative-prefix.c
===================================================================
*** make-relative-prefix.c      (revision 130159)
--- make-relative-prefix.c      (working copy)
*************** make_relative_prefix_1 (const char *prog
*** 292,305 ****
        }
      }

!   if ( resolve_links )
!     {
!       full_progname = lrealpath (progname);
!       if (full_progname == NULL)
!       return NULL;
!     }
    else
!     full_progname = strdup(progname);

    prog_dirs = split_directories (full_progname, &prog_num);
    free (full_progname);
--- 292,303 ----
        }
      }

!   if (resolve_links)
!     full_progname = lrealpath (progname);
    else
!     full_progname = strdup (progname);
!   if (full_progname == NULL)
!     return NULL;

    prog_dirs = split_directories (full_progname, &prog_num);
    free (full_progname);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: RFA: fix to thinko in make-relative-prefix.c:make_relative_prefix_1
  2007-11-14  0:13 RFA: fix to thinko in make-relative-prefix.c:make_relative_prefix_1 Douglas Evans
@ 2008-02-16  6:17 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2008-02-16  6:17 UTC (permalink / raw)
  To: Douglas Evans; +Cc: gcc-patches

"Douglas Evans" <dje@google.com> writes:

> Simple thinko.  Return of NULL from strdup isn't checked.
> 
> Ok to check in?
> 
> 2007-11-13  Doug Evans  <dje@google.com>
> 
>         * make-relative-prefix.c (make_relative_prefix_1): Handle NULL
>         return from strdup.

This is OK.

However, at this point it should wait until gcc 4.3 has branched.
Sorry for the rather slow review.

Thanks.

Ian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-16  2:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-14  0:13 RFA: fix to thinko in make-relative-prefix.c:make_relative_prefix_1 Douglas Evans
2008-02-16  6:17 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).