summaryrefslogtreecommitdiff
path: root/perl/Wallet
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2008-02-09 02:07:53 +0000
committerRuss Allbery <rra@stanford.edu>2008-02-09 02:07:53 +0000
commit9feb152a52ec8b28231fdbb2590e0544e683d956 (patch)
tree23d280a9469d82214edc4657dd86bfd8f509efab /perl/Wallet
parentb415b347328e7db0f41f0294c06060c6dd156b3d (diff)
Actually implement FILE_MAX_SIZE.
Diffstat (limited to 'perl/Wallet')
-rw-r--r--perl/Wallet/Object/File.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/perl/Wallet/Object/File.pm b/perl/Wallet/Object/File.pm
index 2b18bb2..b4e23f8 100644
--- a/perl/Wallet/Object/File.pm
+++ b/perl/Wallet/Object/File.pm
@@ -104,6 +104,13 @@ sub store {
$self->error ("cannot store $id: object is locked");
return;
}
+ if ($Wallet::Config::FILE_MAX_SIZE) {
+ my $max = $Wallet::Config::FILE_MAX_SIZE;
+ if (length ($data) > $max) {
+ $self->error ("data exceeds maximum of $max bytes");
+ return;
+ }
+ }
my $path = $self->file_path;
return unless $path;
unless (open (FILE, '>', $path)) {