From: Jean-Marc Pigeon (Delson) Date: Mon, 7 Jul 2025 09:55:23 +0000 (-0400) Subject: Adjusting code gor auth_plain X-Git-Tag: tag-0.12~1 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=7d064dd249ee7ad006ceeabd05c8f1647d4e5c28;p=jmp%2Fmailleur Adjusting code gor auth_plain --- diff --git a/lib/lvleml.c b/lib/lvleml.c index da40fb6..40ea679 100644 --- a/lib/lvleml.c +++ b/lib/lvleml.c @@ -322,13 +322,11 @@ static char *get_auth_plain(CONTYP *contact,int delay,char *received) { #define OPEP "lvleml.c:get_auth_plain," + char *decoded; -char local[200]; decoded=(char *)0; -(void) memset(local,'\000',sizeof(local)); -(void) strncpy(local,received,sizeof(local)-1); -if (strlen(local)==0) { +if ((received==(char *)0)||(strlen(received)==0)) { char *line; int got; @@ -337,12 +335,12 @@ if (strlen(local)==0) { got=tcp_getline(contact->socptr,delay,&line); if (got>0) { (void) log_fprintlog(contact->logptr,false,"%s",line); - (void) strncpy(local,line,sizeof(local)-1); + decoded=cnv_getb64(line); line=rou_freestr(line); } } -if (strlen(local)>0) - decoded=cnv_getb64(local); +else + decoded=cnv_getb64(received); return decoded; #undef OPEP