Re: [PATCH] Fix a use of uninitialised memory in an agetty error path.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > @@ -2000,12 +2003,15 @@ static char *get_logname(struct options *op, struct termios *tp, struct chardata
> >                                 case ESRCH:
> >                                 case EINVAL:
> >                                 case ENOENT:
> > -                                       break;
> > +                                       exit_slowly(EXIT_SUCCESS);
> >                                 default:
> >                                         log_err(_("%s: read: %m"), op->tty);
> >                                 }
> >                         }
> > 
> > +                       if (readres == 0)
> > +                               c = 0;
> > +
> >                         /* Do parity bit handling. */
> >                         if (eightbit)
> >                                 ascval = c;
> > @@ -2030,6 +2036,8 @@ static char *get_logname(struct options *op, struct termios *tp, struct chardata
> >                         switch (key) {
> >                         case 0:
> >                                 *bp = 0;
> > +                               if (op->flags & F_VCONSOLE)
> > +                                       exit_slowly(EXIT_SUCCESS);
> >                                 if (op->numspeed > 1)
> >                                         return NULL;
> 
> Yes, that's what I've though about. I have committed a little bit modified
> version:
> 
> -                               if (op->numspeed > 1)
> +                               if (op->numspeed > 1 && !(op->flags & F_VCONSOLE))
>                                         return NULL;
> +                               if (readres == 0)
> +                                       exit_slowly(EXIT_SUCCESS);
>                                 break;
> 
> the speed configuration should be accepted only for !F_VCONSOLE.

That's great, thank you.

Steven.
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux