Bug #23036

Read of uninitialized variable in t3lib_div::normalizeIPv6

Added by Oliver Klee over 9 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2010-06-29
Due date:
% Done:

100%

TYPO3 Version:
4.4
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

$h is read before it is initialized:

public static function normalizeIPv6($address)    {
$normalizedAddress = '';
$stageOneAddress = '';
$chunks = explode('::', $address);    // Count 2 if if address has hidden zero blocks
if (count($chunks)==2) {
$chunksLeft = explode(':', $chunks[0]);
$chunksRight = explode(':', $chunks[1]);
$left = count($chunksLeft);
$right = count($chunksRight);
// Special case: leading zero-only blocks count to 1, should be 0
if ($left==1 && strlen($chunksLeft[0])==0) $left=0;
$hiddenBlocks = 8 - ($left + $right);
$hiddenPart = '';
while ($h<$hiddenBlocks) {
$hiddenPart .= '0000:';
$h++;
}

(issue imported from #M14915)


Related issues

Related to TYPO3 Core - Bug #23593: Set readLLPHPfile to deprecated, resolve undefined vars in t3lib_div Closed 2010-09-24

Associated revisions

Revision 5b0ec0d0 (diff)
Added by Stefan Neufeind over 8 years ago

[BUGFIX] Read of uninitialized variable in t3lib_div::normalizeIPv6

Backport of fix from 4.5-branch (initialize variable, one-liner).

Change-Id: Ib22e3f5b1093a5c38dde2bd6bd8b31a0049fd796
Resolves: #23036
Releases: 4.4
Reviewed-on: http://review.typo3.org/2520
Reviewed-by: Steffen Gebert
Tested-by: Steffen Gebert

History

#1 Updated by Mr. Hudson over 8 years ago

Patch set 1 of change Ib22e3f5b1093a5c38dde2bd6bd8b31a0049fd796 has been pushed to the review server.
It is available at http://review.typo3.org/2520

#2 Updated by Mr. Hudson over 8 years ago

Patch set 2 of change Ib22e3f5b1093a5c38dde2bd6bd8b31a0049fd796 has been pushed to the review server.
It is available at http://review.typo3.org/2520

#3 Updated by Stefan Neufeind over 8 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

#4 Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF