php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13190 shm_put_var() problem with free space calculation
Submitted: 2001-09-07 06:43 UTC Modified: 2001-10-02 19:39 UTC
From: phpbug at oderwat dot de Assigned:
Status: Closed Package: *Extensibility Functions
PHP Version: 4.0.6 OS: Linux SuSE 6.3 - Apache
Private report: No CVE-ID: None
 [2001-09-07 06:43 UTC] phpbug at oderwat dot de
It seems that "shm_put_var()" has a problem with the
calculation of free space for setting a variable the
second time. I guess it calculates the remaining free
space including the size taken by the old variable

<?php
$str=str_repeat("-",30); // 52 (max which fits in 100) is even worse
$shm=shm_attach(0xfffe,100);
shm_put_var($shm,1,$str);
//shm_put_var($shm,1,0); // using that will make next statement work without error
shm_put_var($shm,1,$str); // THIS will tell you there is not enoug memory left!
shm_detach($shm);
shm_remove(0xfffe);
?>

Sincerely,
 Hans Raaf

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-09-07 07:05 UTC] wez@php.net
Please try latest CVS or a snapshot.
I've just commit a fix for this.
 [2001-10-02 19:39 UTC] sniper@php.net
No feedback and should be fixed in CVS.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 07 03:01:28 2024 UTC