Seg fault in fix-header; 20000320; Solaris

Jeffrey A Law law@cygnus.com
Wed Mar 29 18:20:00 GMT 2000


  In message < 200003212055.MAA20908@mushroom.jpl.nasa.gov >you write:
  > 
  > cppinit.c does not check for NULL pointer, causing fix-header to crash.
  > 
  > mushroom~...gcc>diff -c cppinit.c.orig cppinit.c
  > *** cppinit.c.orig      Tue Mar 21 09:45:27 2000
  > --- cppinit.c   Tue Mar 21 09:46:45 2000
  > ***************
  > *** 726,732 ****
  >     /* Print the expected object file name as the target of this Make-rule.
  >   */
  >     if (opts->deps_target)
  >       deps_add_target (pfile->deps, opts->deps_target);
  > !   else if (*opts->in_fname == 0)
  >       deps_add_target (pfile->deps, "-");
  >     else
  >       deps_calc_target (pfile->deps, opts->in_fname);
  > --- 726,732 ----
  >     /* Print the expected object file name as the target of this Make-rule.
  >   */
  >     if (opts->deps_target)
  >       deps_add_target (pfile->deps, opts->deps_target);
  > !   else if ((opts->in_fname == NULL) || (*opts->in_fname == 0))
  >       deps_add_target (pfile->deps, "-");
  >     else
  >       deps_calc_target (pfile->deps, opts->in_fname);
There's no explanation for why opts->in_fname was null to begin with --
without that critical piece of information, it's much more difficult to
tell if your patch is correct or if it's just papering over a problem
elsewhere.

Please describe precisely how/why opts->in_fname can legitimately have a
value of zero so that we can evaluate your patch.

Thanks,
jeff

  > 




More information about the Gcc-bugs mailing list