[Cbe-oss-dev] [PATCH 10/10] MARS: workload type move from context to queue block

Geert Uytterhoeven Geert.Uytterhoeven at sonycom.com
Wed Aug 6 19:28:13 EST 2008


On Tue, 5 Aug 2008, Geoff Levand wrote:
> Yuji Mano wrote:
> >  	/* copy the task name into task id */
> >  	if (params->name) {
> >  		MARS_CHECK_RET(strlen(params->name) < MARS_TASK_NAME_LEN_MAX,
> >  				MARS_ERROR_PARAMS);
> > -		strcpy((char *)&task->id.name, params->name);
> > +		strcpy((char *)&task.id.name, params->name);
> 
> What if params->name is too big, should this be strncpy?

Or strlcpy(), as strncpy() is not guaranteed to zero-terminate the destination
buffer?

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   Geert.Uytterhoeven at sonycom.com
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis 293-0376800-10 GEBA-BE-BB


More information about the cbe-oss-dev mailing list