Skip Menu |

This queue is for tickets about the IPC-ShareLite CPAN distribution.

Report information
The Basics
Id: 64657
Status: new
Priority: 0/
Queue: IPC-ShareLite

People
Owner: Nobody in particular
Requestors: josh [...] honorablemenschen.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Bug in IPC::ShareLite 0.17
Date: Mon, 10 Jan 2011 12:07:05 -0500 (EST)
To: bug-IPC-ShareLite [...] rt.cpan.org
From: "Joshua Megerman" <josh [...] honorablemenschen.com>
IPC::ShareLite states the the shm key must be an integer value, which by definition can be either positive or negative. Also, the IPC interface uses signed integers for key_t (at least on Linux), requiring negative integers to access half of the available keys (since any value over INT_MAX is treated by the shm interface as INT_MAX). IPC::ShareLite uses the regex /^\d+$/ to determine if the key is an integer, which explicity prevents otherwise negative values from being used. The solution is to change the regex on line 202 of IPC/ShareLite.pm to /^-?\d+$/, which won't barf on negative integers. Also, you may wish to put in some validation that the value passed is not Show quoted text
> MAX_INT or < (-MAX_INT - 1), but that's probably better left for the
user of your module :) Thanks for making a great module, and I hope this change makes it into an official release. Josh Joshua Megerman SJGames MIB #5273 - OGRE AI Testing Division You can't win; You can't break even; You can't even quit the game. - Layman's translation of the Laws of Thermodynamics josh@honorablemenschen.com