aboutsummaryrefslogtreecommitdiffstats
path: root/Bugzilla/Attachment.pm
diff options
context:
space:
mode:
authorGervase Markham <gerv@mozilla.org>2015-01-21 20:06:08 +0000
committerDavid Lawrence <dkl@mozilla.com>2015-01-21 20:06:08 +0000
commit19117cc3e4da268d64107957e4c206d8df875505 (patch)
tree81546dbda0b66c7463407c3854ee98689326dc15 /Bugzilla/Attachment.pm
parent272b0b69b2884d937ffd4b5b01fb89235603c67c (diff)
downloadbugs-19117cc3e4da268d64107957e4c206d8df875505.tar
bugs-19117cc3e4da268d64107957e4c206d8df875505.tar.gz
bugs-19117cc3e4da268d64107957e4c206d8df875505.tar.bz2
bugs-19117cc3e4da268d64107957e4c206d8df875505.tar.xz
bugs-19117cc3e4da268d64107957e4c206d8df875505.zip
Bug 1079065: [SECURITY] Always use the 3 arguments form for open() to prevent shell code injection
r=dkl,a=glob
Diffstat (limited to 'Bugzilla/Attachment.pm')
-rw-r--r--Bugzilla/Attachment.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm
index b44c94cd0..932fb6b17 100644
--- a/Bugzilla/Attachment.pm
+++ b/Bugzilla/Attachment.pm
@@ -328,7 +328,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())) {
local $/;
binmode AH;
$self->{data} = <AH>;
@@ -374,7 +374,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())) {
binmode AH;
$self->{datasize} = (stat(AH))[7];
close(AH);