[PD-dev] [ pure-data-Patches-1688540 ] fix makefilename segfault when wrong argument type received

SourceForge.net noreply at sourceforge.net
Mon Mar 26 18:33:55 CEST 2007


Patches item #1688540, was opened at 2007-03-26 12:33
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=478072&aid=1688540&group_id=55736

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: puredata-dev
Group: bugfix
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Stephen Sinclair (radarsat1)
Assigned to: Nobody/Anonymous (nobody)
Summary: fix makefilename segfault when wrong argument type received

Initial Comment:
Currently, Pd segfaults if the "makefilename" object is configured to receive a symbol ("%s") and it receives a float argument.

This patch uses strstr() to check if the sprintf string is going to accept a float, like so:

strstr(s->s_name, "%s")==0

The result is saved in the t_makefilename structure.  It is recalculated on the "set" message.

When the wrong message type is received, a 0 or "" string is substituted, respectfully.

While it is unfortunate to do a string search like this, it is not very good to have Pd segfaulting, so I see no alternative.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=478072&aid=1688540&group_id=55736




More information about the Pd-dev mailing list