mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-06 00:10:04 +01:00
fix possible close of unrelated fd on error path
- infd var is uninitialised on error path in case where maxlen is less than 1
This commit is contained in:
committed by
Milan Broz
parent
ce30d5f1fd
commit
3cffadb508
@@ -179,7 +179,7 @@ static int interactive_pass(const char *prompt, char *pass, size_t maxlen,
|
|||||||
int infd, outfd;
|
int infd, outfd;
|
||||||
|
|
||||||
if (maxlen < 1)
|
if (maxlen < 1)
|
||||||
goto out_err;
|
return failed;
|
||||||
|
|
||||||
/* Read and write to /dev/tty if available */
|
/* Read and write to /dev/tty if available */
|
||||||
infd = open("/dev/tty", O_RDWR);
|
infd = open("/dev/tty", O_RDWR);
|
||||||
|
|||||||
Reference in New Issue
Block a user