← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] correct some snprintf usage

 

Mark,

I committed your patch in the product branch version r5447.  Thank you
for your contribution.

On 2/21/2015 10:00 PM, Mark Roszko wrote:
> Fixes some cases where n-1 bytes was used as a size but snprintf
> protects against that internally. Also some hardcoded constant sizes
> changed to sizeof()
> 
> And made a case where sprintf was used into snprintf as the path input
> as aUserPluginsPath could in theory be very stupid long if someone has
> a very stupid filesystem. Would be best if there was error handling if
> it exceeds ( snprintf will return greater than sizeof(buf) ) but I
> have no clue how that section needs cleanup.

There is probably a python API call that would allow you to use a python
error to display to the user and return false from
pcbnewInitPythonScripting to prevent python from running with an invalid
user path.  Also, python might complain if the path isn't valid in which
case you might not have to do anything.

Cheers,

Wayne

> 
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 



Follow ups

References