in the end, this possibly triple bug report belongs more on pd-list than
in private mails.
On Wed, 24 Mar 2010, Mathieu Bouchard wrote:
> On Wed, 24 Mar 2010, Mathieu Bouchard wrote:
>
>> il y a trop de sprintf dans mp3cast_connect pour qu'on puisse facilement
>> identifier lequel.
>
> actually, not so bad :
>
> resp is 32 bytes
>
> sprintf(resp, "%d", x->x_bitrate) is maximum 12 bytes because %d
> outputs at most 11 bytes and then there's one end-of-string byte.
> this is fine. this sprintf occurs twice.
>
> sprintf(resp, "source:%s", x->x_passwd); implies that x->x_passwd has to
> be not more than 24 bytes long (plus terminator).
>
> sprintf(resp, "Authorization: Basic %s\r\n", base64); is 24 bytes plus
> strlen(base64). thus base64 is a string that shouldn't be longer than 8
> bytes (plus terminator). mp3cast_base64_encode produces that string.
>
> sprintf(resp, "\r\nice-audio-info: bitrate=%d", x->x_bitrate) is 27
> bytes plus the bitrate. Thus if x_bitrate is any value higher than 99999
> or lower than -9999, you have a bug.
>
> that's already all.
>
> _ _ __ ___ _____ ________ _____________ _____________________ ...
> | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
_ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801