Bugzilla – Attachment 64969 Details for
Bug 18854
DoS Offset
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18854: Protect few other occurrences of offset
Bug-18854-Protect-few-other-occurrences-of-offset.patch (text/plain), 3.53 KB, created by
Jonathan Druart
on 2017-07-10 14:57:35 UTC
(
hide
)
Description:
Bug 18854: Protect few other occurrences of offset
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-07-10 14:57:35 UTC
Size:
3.53 KB
patch
obsolete
>From e61f22ccf1a02a351f036a4961f776dce9917875 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 10 Jul 2017 11:56:46 -0300 >Subject: [PATCH] Bug 18854: Protect few other occurrences of offset > >--- > C4/AuthoritiesMarc.pm | 2 +- > Koha/SearchEngine/Elasticsearch/Search.pm | 3 ++- > admin/auth_subfields_structure.pl | 3 ++- > admin/auth_tag_structure.pl | 3 ++- > admin/marc_subfields_structure.pl | 3 ++- > 5 files changed, 9 insertions(+), 5 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 87620b45cf..9f1f284353 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -240,7 +240,7 @@ sub SearchAuthorities { > $query="\@or $orderstring $query" if $orderstring; > } > >- $offset=0 unless $offset; >+ $offset = 0 if not defined $offset or $offset < 0; > my $counter = $offset; > $length=10 unless $length; > my @oAuth; >diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm >index 9f0e2a5991..cec1cb7fb6 100644 >--- a/Koha/SearchEngine/Elasticsearch/Search.pm >+++ b/Koha/SearchEngine/Elasticsearch/Search.pm >@@ -327,7 +327,8 @@ sub simple_search_compat { > return ('No query entered', undef, undef) unless $query; > > my %options; >- $options{offset} = $offset // 0; >+ $offset = 0 if not defined $offset or $offset < 0; >+ $options{offset} = $offset; > $max_results //= 100; > > unless (ref $query) { >diff --git a/admin/auth_subfields_structure.pl b/admin/auth_subfields_structure.pl >index 0ba7677a98..37249e6826 100755 >--- a/admin/auth_subfields_structure.pl >+++ b/admin/auth_subfields_structure.pl >@@ -52,7 +52,8 @@ my $input = new CGI; > my $tagfield = $input->param('tagfield'); > my $tagsubfield = $input->param('tagsubfield'); > my $authtypecode = $input->param('authtypecode'); >-my $offset = $input->param('offset') || 0; >+my $offset = $input->param('offset'); >+$offset = 0 if not defined $offset or $offset < 0; > my $op = $input->param('op') || ''; > my $script_name = "/cgi-bin/koha/admin/auth_subfields_structure.pl"; > >diff --git a/admin/auth_tag_structure.pl b/admin/auth_tag_structure.pl >index 4a3a67a1bf..ddf163acbc 100755 >--- a/admin/auth_tag_structure.pl >+++ b/admin/auth_tag_structure.pl >@@ -35,7 +35,8 @@ my $authtypecode = $input->param('authtypecode') || ''; # set > my $existingauthtypecode = $input->param('existingauthtypecode') || ''; # set when we have to create a new framework (in authtype) by copying an old one (in existingauthtype) > > my $searchfield = $input->param('searchfield') || 0; >-my $offset = $input->param('offset') || 0; >+my $offset = $input->param('offset'); >+$offset = 0 if not defined $offset or $offset < 0; > my $op = $input->param('op') || ''; > $searchfield =~ s/\,//g; > >diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl >index 24c8005800..077a58b40e 100755 >--- a/admin/marc_subfields_structure.pl >+++ b/admin/marc_subfields_structure.pl >@@ -65,7 +65,8 @@ my $tagfield = $input->param('tagfield'); > my $tagsubfield = $input->param('tagsubfield'); > my $frameworkcode = $input->param('frameworkcode'); > my $pkfield = "tagfield"; >-my $offset = $input->param('offset') || 0; >+my $offset = $input->param('offset'); >+$offset = 0 if not defined $offset or $offset < 0; > my $script_name = "/cgi-bin/koha/admin/marc_subfields_structure.pl"; > > my ( $template, $borrowernumber, $cookie ) = get_template_and_user( >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18854
:
64611
|
64612
|
64617
|
64799
|
64800
|
64888
|
64889
|
64969
|
65039
|
65040