Fossil SCM
Stop with an error when getpass() returns NULL. The result was used without a check.
Commit
c1b050255c1419aef2be6ccb825979f3f98ad4c0d9307d0c069094fc8fa14407
Parent
98f68f69d28ba45…
1 file changed
+1
+1
| --- src/user.c | ||
| +++ src/user.c | ||
| @@ -227,10 +227,11 @@ | ||
| 227 | 227 | if( z ) userDescramble(z); |
| 228 | 228 | printf("\033[3A\033[J"); /* Erase previous three lines */ |
| 229 | 229 | fflush(stdout); |
| 230 | 230 | }else{ |
| 231 | 231 | z = getpass(zPrompt); |
| 232 | + if( z==0 ) fossil_fatal("unable to read a password"); | |
| 232 | 233 | } |
| 233 | 234 | strip_string(pPassphrase, z); |
| 234 | 235 | } |
| 235 | 236 | |
| 236 | 237 | /* |
| 237 | 238 |
| --- 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 |