<?xml version="1.0"?>
<?xml-stylesheet
href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel rdf:about="http://pear.php.net/bugs/search.php">
    <title>PEAR Bug Search Results</title>
    <link>http://pear.php.net/bugs/search.php?cmd=display&amp;package_name%5B0%5D=System_SharedMemory</link>
    <description>Search Results</description>
    <dc:language>en-us</dc:language>
    <dc:creator>pear-webmaster@lists.php.net</dc:creator>
    <dc:publisher>pear-webmaster@lists.php.net</dc:publisher>
    <admin:generatorAgent rdf:resource="http://pear.php.net/bugs"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    <items>
     <rdf:Seq>
      <rdf:li rdf:resource="http://pear.php.net/bug/11971" />

     </rdf:Seq>
    </items>
  </channel>

  <image rdf:about="http://pear.php.net/gifs/pearsmall.gif">
    <title>PEAR Bugs</title>
    <url>http://pear.php.net/gifs/pearsmall.gif</url>
    <link>http://pear.php.net/bugs</link>
  </image>

    <item rdf:about="http://pear.php.net/bug/11971">
      <title>System_SharedMemory: Bug 11971 [Open] Minor fix for SystemV shared memory</title>
      <link>http://pear.php.net/bugs/11971</link>
      <content:encoded><![CDATA[<pre>System_SharedMemory Bug
Reported by atrerra
2007-09-04T04:48:54+00:00
PHP: 5.1.3 OS: linux Package Version: CVS

Description:
------------
The function _s2i() in Systemv.php is meant to return an integer for use as a unique key in shm_* calls. However it returns an array and not an integer.

The calling function does not throw an error however.

Test script:
---------------
Simply create 2 or more shared memory variables then simply save+retrieve them. 

Due to the bug, all variables will have the same key &quot;Array&quot; and therefore the same value upon get() -ing them.

Expected result:
----------------
Here is the very simple fix (sorry can't roll a patch at the moment)

// in systemV.php, the function:
//------------

function _s2i($name)
{
  return unpack('N', str_pad($name, 4, &quot;\0&quot;, STR_PAD_LEFT));      
}

//Should be:
//----------

function _s2i($name)
{
  return array_shift(unpack('N', str_pad($name, 4, &quot;\0&quot;, STR_PAD_LEFT)));
}

// Since unpack returns an array not an integer as needed</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_SharedMemory Bug
Reported by atrerra
2007-09-04T04:48:54+00:00
PHP: 5.1.3 OS: linux Package Version: CVS

Description:
------------
The function _s2i() in Systemv.php is meant to return an integer for use as a unique key in shm_* calls. However it returns an array and not an integer.

The calling function does not throw an error however.

Test script:
---------------
Simply create 2 or more shared memory variables then simply save+retrieve them. 

Due to the bug, all variables will have the same key &quot;Array&quot; and therefore the same value upon get() -ing them.

Expected result:
----------------
Here is the very simple fix (sorry can't roll a patch at the moment)

// in systemV.php, the function:
//------------

function _s2i($name)
{
  return unpack('N', str_pad($name, 4, &quot;\0&quot;, STR_PAD_LEFT));      
}

//Should be:
//----------

function _s2i($name)
{
  return array_shift(unpack('N', str_pad($name, 4, &quot;\0&quot;, STR_PAD_LEFT)));
}

// Since unpack returns an array not an integer as needed</pre>]]></description>
      <dc:date>2007-09-10T00:08:59+00:00</dc:date>
      <dc:creator>mt74 &amp;#x61;&amp;#116; shaw &amp;#x64;&amp;#111;&amp;#x74; ca</dc:creator>
      <dc:subject>System_SharedMemory Bug</dc:subject>
    </item>
</rdf:RDF>
