Coder Social home page Coder Social logo

pecl-database-dbase's People

Contributors

bjori avatar cmb69 avatar dstogov avatar edinkad avatar faizshukri avatar felipensp avatar fmk avatar helly25 avatar jimwins avatar kallez avatar m6w6 avatar pierrejoye avatar remicollet avatar rlerdorf avatar roojs avatar sebastianbergmann avatar sgolemon avatar stigsb avatar tony2001 avatar weltling avatar zsuraski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pecl-database-dbase's Issues

dbase_add_record() converts passed floats and leaks memory

Description

When an array record passed to dbase_add_record() or dbase_replace_record() contains floats which are going to be written into N or F columns, these floats are converted to string. That also causes a memory leak.

Test script

<?php
$filename = __DIR__ . "/gh-1.dbf";
$db = dbase_create($filename, array(array('num', 'n', 10, 1)));

$record = array(1234.5);
dbase_add_record($db, $record);
var_dump($record);
?>

Expected output

array(1) {
  [0]=>
  float(1234.5)
}

Actual output

array(1) {
  [0]=>
  string(6) "1234.5"
}
[Fri Oct 29 16:40:51 2021]  Script:  'D:\git\pecl\pecl-database-dbase\tests\gh-1.php'
c:\php-sdk\phpdev\vc15\x64\php-src-7.4\zend\zend_string.h(135) :  Freeing 0x0000022f5cc58f80 (32 bytes), script=D:\git\pecl\pecl-database-dbase\tests\gh-1.php
=== Total 1 memory leaks detected ===

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.