Bug 3053 - Server crash during browsedb
: Server crash during browsedb
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Web Interface
: 6.2.2
: PC Windows XP
: P2 major (vote)
: ---
Assigned To: Dan Sully
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-02-23 08:50 UTC by Curt Black
Modified: 2008-09-15 14:38 UTC (History)
0 users

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Curt Black 2006-02-23 08:50:09 UTC
Related bug: 789

When using browsedb, if the "start" parameter is used and is greater than the number of items returned by the DB, the server will crash.  The bug is traced to the following code in function "simpleHeader" in Pages.pm:

--------------------------------
	my ($itemCount, $startRef, $headerRef, $skinOverride, $count, $offset) = @_;

	$count ||= Slim::Utils::Prefs::get('itemsPerPage');

	my $start = (defined($$startRef) && $$startRef ne '') ? $$startRef : 0;

	if ($start >= $itemCount) {
           $start = $itemCount - $count;     <----- HERE
	}
----------------------------------

$start is assigned a negative value assuming your itemsPerPage($count) is larger than the amount of items found.

This is bad when $start is then used to index the array in the browsedb function, as the server will crash ("Modification of non-creatable array value attempted") - may be related to bug #2233
Comment 1 Dan Sully 2006-02-23 09:21:54 UTC
Fixed in the next nightly. Change 6352