mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-07-05 20:41:39 -07:00
Fixing open() off by one error
As reported by coverity: off_by_one: Testing whether handle fd is strictly greater than zero is suspicious. fd leaks when it is zero
This commit is contained in:
parent
5df0ab39c0
commit
392bb0e3b3
1 changed files with 1 additions and 1 deletions
|
@ -690,7 +690,7 @@ void on_btnSave_clicked(GtkButton * button, gpointer user_data) {
|
|||
text = gtk_text_buffer_get_text(outputbuf, &start, &end, TRUE);
|
||||
|
||||
fd = open(filename, O_CREAT | O_TRUNC | O_WRONLY, 0644);
|
||||
if (fd > 0) {
|
||||
if (fd >= 0) {
|
||||
write(fd, text, strlen(text));
|
||||
close(fd);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue