]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Adjusting code gor auth_plain
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Mon, 7 Jul 2025 09:55:23 +0000 (05:55 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Mon, 7 Jul 2025 09:55:23 +0000 (05:55 -0400)
lib/lvleml.c

index da40fb602258df8cef86fd9a13b97b1451b628f8..40ea679954013ed708bab21a3af9b7df4f6d9c02 100644 (file)
@@ -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