RE: [PATCH 4/4] tools: hv: Parse /etc/os-release

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

 




> -----Original Message-----
> From: Alan Cox [mailto:alan@xxxxxxxxxxxxxxxxxxx]
> Sent: Wednesday, September 05, 2012 12:58 PM
> To: KY Srinivasan
> Cc: gregkh@xxxxxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
> devel@xxxxxxxxxxxxxxxxxxxxxx; olaf@xxxxxxxxx; apw@xxxxxxxxxxxxx;
> ben@xxxxxxxxxxxxxxx; thozza@xxxxxxxxxx; dcbw@xxxxxxxxxx
> Subject: Re: [PATCH 4/4] tools: hv: Parse /etc/os-release
> 
> > +			if (!strcmp(buf, "NAME"))
> > +				os_name = strdup(value);
> > +			else if (!strcmp(buf, "VERSION_ID"))
> > +				os_major = strdup(value);
> 
> strdup can fail. The case where it leaks because NAME= occurs twice is
> harmless enough but the strdup ought to be checked or add an x_strdup()
> helper.

I will fix this and resend this patch.

Thank you,

K. Y



_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux