Fossil SCM

Stop with an error when getpass() returns NULL. The result was used without a check.

dmestas 2026-11-12 04:04 UTC small-fixes
Commit c1b050255c1419aef2be6ccb825979f3f98ad4c0d9307d0c069094fc8fa14407
1 file changed +1
+1
--- src/user.c
+++ src/user.c
@@ -227,10 +227,11 @@
227227
if( z ) userDescramble(z);
228228
printf("\033[3A\033[J"); /* Erase previous three lines */
229229
fflush(stdout);
230230
}else{
231231
z = getpass(zPrompt);
232
+ if( z==0 ) fossil_fatal("unable to read a password");
232233
}
233234
strip_string(pPassphrase, z);
234235
}
235236
236237
/*
237238
--- src/user.c
+++ src/user.c
@@ -227,10 +227,11 @@
227 if( z ) userDescramble(z);
228 printf("\033[3A\033[J"); /* Erase previous three lines */
229 fflush(stdout);
230 }else{
231 z = getpass(zPrompt);
 
232 }
233 strip_string(pPassphrase, z);
234 }
235
236 /*
237
--- src/user.c
+++ src/user.c
@@ -227,10 +227,11 @@
227 if( z ) userDescramble(z);
228 printf("\033[3A\033[J"); /* Erase previous three lines */
229 fflush(stdout);
230 }else{
231 z = getpass(zPrompt);
232 if( z==0 ) fossil_fatal("unable to read a password");
233 }
234 strip_string(pPassphrase, z);
235 }
236
237 /*
238

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button