diff options
author | Gervase Markham <gerv@mozilla.org> | 2015-01-21 20:49:57 +0100 |
---|---|---|
committer | David Lawrence <dkl@mozilla.com> | 2015-01-21 20:49:57 +0100 |
commit | 4dabf1a9c679f06b3637d3c76e1e05aa83a6d259 (patch) | |
tree | 93ec377d81b16ad7caccc28c4954048358aa431b /Bugzilla/Attachment.pm | |
parent | 367d9c2f6efd2cc53b773f0c1cc9e19a8d82c5be (diff) | |
download | bugzilla-4dabf1a9c679f06b3637d3c76e1e05aa83a6d259.tar.gz bugzilla-4dabf1a9c679f06b3637d3c76e1e05aa83a6d259.tar.xz |
Bug 1079065: [SECURITY] Always use the 3 arguments form for open() to prevent shell code injection
r=dylan,a=simon
Diffstat (limited to 'Bugzilla/Attachment.pm')
-rw-r--r-- | Bugzilla/Attachment.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm index e165b139e..ed770ad89 100644 --- a/Bugzilla/Attachment.pm +++ b/Bugzilla/Attachment.pm @@ -333,7 +333,7 @@ sub data { # If there's no attachment data in the database, the attachment is stored # in a local file, so retrieve it from there. if (length($self->{data}) == 0) { - if (open(AH, $self->_get_local_filename())) { + if (open(AH, '<', $self->_get_local_filename())) { # file is actually on disk. $self->{is_on_filesystem} = 1; local $/; @@ -412,7 +412,7 @@ sub datasize { # is stored in a local file, and so retrieve its size from the file, # or the attachment has been deleted. unless ($self->{datasize}) { - if (open(AH, $self->_get_local_filename())) { + if (open(AH, '<', $self->_get_local_filename())) { # file is actually on disk. $self->{is_on_filesystem} = 1; binmode AH; |