-
Notifications
You must be signed in to change notification settings - Fork 74
Fix for remote code execution #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,9 +71,16 @@ public static function diff($array, $stats) | |
|
|
||
| # Diff for each key | ||
| foreach ($stats as $key => $value) { | ||
| if (isset($array[$key])) { | ||
| $stats[$key] = $value - $array[$key]; | ||
| } | ||
|
|
||
| if (!isset($array[$key])) | ||
| continue; | ||
|
|
||
| # Make sure we're dealing with a real number | ||
| $v = $array[$key]; | ||
| if (!is_float($v) && !is_int($v)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better add braces here (PSR-2 § 5) |
||
| continue; | ||
|
|
||
| $stats[$key] = $value - $v; | ||
| } | ||
|
|
||
| return $stats; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -222,6 +222,26 @@ if((isset($_REQUEST['server'])) && ($_ini->server($_REQUEST['server']))) | |
| <span class="left setting help" title="Internal name : evicted_unfetched
Items evicted from LRU that were never touched by get/incr/append/etc">Evicted unfetched</span> | ||
| <?php echo (isset($stats['evicted_unfetched'])) ? Library_Data_Analysis::hitResize($stats['evicted_unfetched']) : 'N/A on ' . $stats['version']; ?> | ||
| </div> | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While useful, this block seems unrelated with the security issue. Removing it would make the PR smaller, hence easier to review and merge. |
||
| <? if (isset($stats['*reclaimed_fast'])) { // Additional attributes for custom memcached build ?> | ||
| <div class="line" style="background: #DDFFDD"> | ||
| <span class="left setting help" title="Internal name : *reclaimed_fast
Reclaimed fast from LRU, items that were reclaimed by memory scan">Reclaimed fast</span> | ||
| <?php echo (isset($stats['*reclaimed_fast'])) ? Library_Data_Analysis::hitResize($stats['*reclaimed_fast']) : 'N/A on ' . $stats['version']; ?> | ||
| </div> | ||
| <div class="line" style="background: #CCFFCC"> | ||
| <span class="left setting help" title="Internal name : *reclaimed_fast_bytes
Reclaimed fast from LRU, in bytes">Reclaimed fast bytes</span> | ||
| <?php echo (isset($stats['*reclaimed_fast_bytes'])) ? Library_Data_Analysis::hitResize($stats['*reclaimed_fast_bytes']) : 'N/A on ' . $stats['version']; ?> | ||
| </div> | ||
| <div class="line" style="background: #DDFFDD"> | ||
| <span class="left setting help" title="Internal name : *reclaim_item_passes
Reclaimed item passes, number of times memory was scanned for old items">Reclaimed item passes</span> | ||
| <?php echo (isset($stats['*reclaim_item_passes'])) ? Library_Data_Analysis::hitResize($stats['*reclaim_item_passes']) : 'N/A on ' . $stats['version']; ?> | ||
| </div> | ||
| <div class="line" style="background: #CCFFCC"> | ||
| <span class="left setting help" title="Internal name : *reclaim_item_found
Number of old items found using memory scan">Reclaim item found</span> | ||
| <?php echo (isset($stats['*reclaim_item_found'])) ? Library_Data_Analysis::hitResize($stats['*reclaim_item_found']) : 'N/A on ' . $stats['version']; ?> | ||
| </div> | ||
| <? } ?> | ||
|
|
||
| </div> | ||
|
|
||
| <?php | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra spaces