[Koha-bugs] [Bug 12916] Use of uninitialized values $max and $min in C4/Tags.pm

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Oct 22 21:06:24 CEST 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12916

--- Comment #4 from M. Tompsett <mtompset at hotmail.com> ---
Comment on attachment 32590
  --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=32590
[SIGNED-OFF] Bug 12916 - Use of uninitialized values $max and $min in
C4/Tags.pm

Review of attachment 32590:
 --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=12916&attachment=32590)
-----------------------------------------------------------------

::: C4/Tags.pm
@@ +589,4 @@
>  sub stratify_tags {
>      my ( $strata, $tags ) = @_;
>  
> +    my ( $min, $max ) = ( 0, 0 );

I'm not sure this is the correct solution.
Look at 595. There is a !defined($min) check.
The problem is there is nothing in the @$tags.
By initializing to 0, if there are tags, and the minimum is 5, the minimum is
never set correctly.
Similarly, if there are tags, and the maximum is negative, the maximum is never
set correctly.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list