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

Re: cvs commit to debian-installer/tools/partkit by wart



On Wed, Sep 04, 2002 at 05:59:12PM -0700, Michael Cardenas wrote:
> +//mbc - for now, just use the first device
> +char *partkit_get_default_device(void)
> +{
> +  PedDevice *dev = NULL;
> +  char *ptr = 0;
> + 
> +  dev = ped_device_get_next(dev);
> +
> +  ptr = (char *)malloc(strlen(dev->path));
> +
> +  strcpy(ptr, dev->path);

This is wrong; you aren't allocating space for the
NUL-terminator.  Use strdup instead.

Matt



Reply to: