[MPlayer-dev-eng] http stream basic auth base64_encode() fix
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon Mar 6 23:22:52 CET 2006
Hi,
It's late so excuse any thinking-errors...
> } else {
> - // Terminate with Mime style '='
> - *out = '=';
> - outLen++;
> -
> - return outLen;
> + // Pad with 0 to 2 '=' chars as needed
> + if (outLen & 3)
> + memset(out, '=', 4 - (outLen & 3) );
> + return (outLen + 3) & ~3;
Actually, IMHO memset is actually not a good idea in this case, I
prefer your old patch in this regard.
The real reason I posted my patch is because you do not check the maxlen
value here and might be writing beyond the buffer.
So I think the best solution would be your original patch + my
maxlen &= ~3;
line.
Greetings,
Reimar Döffinger
More information about the MPlayer-dev-eng
mailing list