IBM Support

IT17202: DP:SUBSTRING-BASE64() MIGHT RESTART DATAPOWER WITH OFFSET PARAMETER OUTSIDE VALID RANGE

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • dp:substring-base64() might restart device with offset
    parameter outside valid range
    

Local fix

  • Workaround crash avoidance by replacing all occurences of
    "dp:substing-base64()" with provided "func:substring-base64()",
    see (A), attached as well.
    
    
    (A)
    <!-- func:substring-base64() workaround for
    dp:substring-base64() -->
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:func="http://exslt.org/functions"
      xmlns:dp="http://www.datapower.com/extensions"
      extension-element-prefixes="dp"
    >
      <xsl:template match="/">
          <xsl:copy-of select="'' = func:substring-base64('', 6,
    29)"/>
    <!--  <xsl:copy-of select="'' = dp:substring-base64('', 6,
    29)"/> -->
      </xsl:template>
    
      <func:function name="func:substring-base64">
        <xsl:param name="string"/>
        <xsl:param name="offset"/>
        <xsl:param name="length"/>
    
        <func:result>
          <xsl:choose>
            <xsl:when test="($offset &lt; 1) or
                            ($offset >
    func:base64-length($string))" />
            <xsl:otherwise>
              <xsl:value-of
                select="dp:substring-base64($string, $offset,
    $length)" />
            </xsl:otherwise>
          </xsl:choose>
        </func:result>
      </func:function>
    
      <func:function name="func:base64-length">
        <xsl:param name="bytes"/>
    
        <xsl:choose>
          <xsl:when test="contains($bytes,'==')">
            <func:result select="(string-length($bytes) div 4) * 3
    - 2"/>
          </xsl:when>
          <xsl:when test="contains($bytes,'=')">
            <func:result select="(string-length($bytes) div 4) * 3
    - 1"/>
          </xsl:when>
          <xsl:otherwise>
            <func:result select="(string-length($bytes) div 4) *
    3"/>
          </xsl:otherwise>
        </xsl:choose>
      </func:function>
    
    </xsl:stylesheet>
    

Problem summary

  • All users of dp:substring-base64() extension function are
    affected with a potential restart when the offset is set out of
    bounds of the input size.
    

Problem conclusion

Temporary fix

  • Explictly check the boundaries in the stylesheet or use the
    preapred workaround function "func:substring-base64" in the
    original description of this APAR.
    

Comments

APAR Information

  • APAR number

    IT17202

  • Reported component name

    DATAPOWER

  • Reported component ID

    DP1234567

  • Reported release

    750

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-09-23

  • Closed date

    2017-01-10

  • Last modified date

    2017-01-18

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    DATAPOWER

  • Fixed component ID

    DP1234567

Applicable component levels

  • R700 PSN

       UP

  • R710 PSN

       UP

  • R720 PSN

       UP

  • R750 PSN

       UP

  • R751 PSN

       UP

  • R752 PSN

       UP

[{"Line of Business":{"code":"LOB45","label":"Automation"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SS9H2Y","label":"IBM DataPower Gateways"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"750"}]

Document Information

Modified date:
26 September 2021