php / php/php-src

Signed integer overflow when setting ATTR_TIMEOUT

Open
#17,746 2 comments 1 reaction 2 assignees View on GitHub

@cmb69 is already working on this.

Since Feb 18, 2025.

Bug Extension: pdo_sqlite Status: Verified
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

The following code:

<?php
$pdo = new PDO("sqlite:".__DIR__."/foo.db");
var_dump($pdo->setAttribute(PDO::NULL_TO_STRING, PHP_INT_MIN));

Resulted in this output:

/home/phpfuzz/WorkSpace/flowfusion/php-src/ext/pdo_sqlite/sqlite_driver.c:304:37: runtime error: signed integer overflow: -9223372036854775808 * 1000 cannot be represented in type 'long'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/phpfuzz/WorkSpace/flowfusion/php-src/ext/pdo_sqlite/sqlite_driver.c:304
PHP Version

nightly

Operating System

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.