mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
add a memory check just in case
This commit is contained in:
parent
b6536ddf88
commit
b1f79b9d35
@ -137,6 +137,10 @@ cmd_connect(gchar **args, struct cmd_help_t help)
|
||||
if(stream){
|
||||
// Limit to READ_BUF_SIZE bytes to prevent overflows in the case of a poorly chosen command
|
||||
account->password = g_malloc(READ_BUF_SIZE);
|
||||
if(!account->password){
|
||||
log_error("Failed to allocate enough memory to read eval_password output");
|
||||
return TRUE;
|
||||
}
|
||||
account->password = fgets(account->password, READ_BUF_SIZE, stream);
|
||||
pclose(stream);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user