On Thu, Jun 16, 2016 at 10:31:55AM -0700, Vasu Dev wrote:
> On Wed, 2016-06-15 at 16:47 +0200, Johannes Thumshirn wrote:
> > Fix 3 possible buffer overflows when strncat()ing strings together.
> > 
> > Signed-off-by: Johannes Thumshirn <[email protected]>
> > ---
> >  fcoeadm_display.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/fcoeadm_display.c b/fcoeadm_display.c
> > index 16ccb6b..7b95aa4 100644
> > --- a/fcoeadm_display.c
> > +++ b/fcoeadm_display.c
> > @@ -267,13 +267,13 @@ static void show_full_lun_info(unsigned int
> > hba, unsigned int port,
> >     if (!port_attrs)
> >             goto free_rport;
> >  
> > -   strncat(path, "/device/", sizeof(path));
> > +   strncat(path, "/device/", sizeof(path) - strlen(path) - 1);
> >  
> >     sa_sys_read_line(path, "rev", rev, sizeof(rev));
> >     sa_sys_read_line(path, "model", model, sizeof(model));
> >     sa_sys_read_line(path, "vendor", vendor, sizeof(vendor));
> >  
> > -   strncat(path, "block", sizeof(path));
> > +   strncat(path, "block", sizeof(path) - strlen(path) - 1);
> >  
> >     dir = opendir(path);
> >     if (!dir)
> > @@ -349,7 +349,7 @@ static void show_short_lun_info(unsigned int hba,
> > unsigned int port,
> >     sa_sys_read_line(path, "model", model, sizeof(model));
> >     sa_sys_read_line(path, "vendor", vendor, sizeof(vendor));
> >  
> > -   strncat(path, "block", sizeof(path));
> > +   strncat(path, "block", sizeof(path) - strlen(path) - 1);
> >  
> >     dir = opendir(path);
> >     if (!dir)
> 
> Looks good, I'll apply this and it may be last patch as I'm moving away
> from maintaining this project.

Yeah, heared the rumors. Sad that it's true but thanks for the Job you did.

It was nice working with you.

        Johannes

-- 
Johannes Thumshirn                                          Storage
[email protected]                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
_______________________________________________
fcoe-devel mailing list
[email protected]
http://lists.open-fcoe.org/mailman/listinfo/fcoe-devel

Reply via email to