Skip to content
This repository was archived by the owner on Oct 10, 2019. It is now read-only.
This repository was archived by the owner on Oct 10, 2019. It is now read-only.

segfaults on throwing Exception #10

@razorness

Description

@razorness

There is a Bug in PHP 5.6 which produces segfaults when you throw an exception encoded in ISO-8859-1 on a system with default charset UTF-8.

Throwing a KlarnaException caused by response faultCode !== 0 and faultString (ISO-8859-1) results in segfaults in apache child process.

Example:
https://github.com/klarna/php-xmlrpc/blob/v4.1/src/Klarna.php#L3661

To prevent this, you could use something like this:

throw new KlarnaException(
    iconv('ISO-8859-1//TRANSLIT', ini_get('default_charset'), $xmlrpcresp->faultString()), 
    $status
);

Tested on:

Test:

throw new Exception(iconv(ini_get('default_charset'), 'ISO-8859-1', 'ß'));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions