1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Handle newline-trimmed input TEXT correctly in base64, base85 UDFs.

FossilOrigin-Name: 8f637aae23e6638c064a34262dcf16a3cdfd000fb1fa1b2a834b292fe6659408
This commit is contained in:
larrybr
2023-04-25 04:28:39 +00:00
parent 21461407f6
commit 38c2052767
4 changed files with 14 additions and 14 deletions

View File

@ -140,9 +140,9 @@ static u8 base85DigitValue( char c ){
#define B85_DARK_MAX 80
static char * skipNonB85( char *s ){
static char * skipNonB85( char *s, int nc ){
char c;
while( (c = *s) && !IS_B85(c) ) ++s;
while( nc-- > 0 && (c = *s) && !IS_B85(c) ) ++s;
return s;
}
@ -212,7 +212,7 @@ static u8* fromBase85( char *pIn, int ncIn, u8 *pOut ){
if( ncIn>0 && pIn[ncIn-1]=='\n' ) --ncIn;
while( ncIn>0 ){
static signed char nboi[] = { 0, 0, 1, 2, 3, 4 };
char *pUse = skipNonB85(pIn);
char *pUse = skipNonB85(pIn, ncIn);
unsigned long qv = 0L;
int nti, nbo;
ncIn -= (pUse - pIn);