Could someone please help me to resolve the following error.
Integer overflow in hexadecimal number at Keystore.pm line 1106.
Hexadecimal number > 0xffffffff non-portable Keystore.pm line 1106.
Thanks in advance
10 20727 RonB 589
Expert Mod 512MB
Can you post the complete line of code at line 1106?
What OS are you on?
What version of Perl are you using?
Do you get the same error from this test script? - #!/usr/bin/perl
-
-
use warnings;
-
-
print 0xffffffff, "\n"; # comment this line out if you receive the error
-
-
print 2**32, "\n"; # does this produce the same error?
-
$ cat test.pl -
#!/usr/bin/perl
-
-
use warnings;
-
-
print 0xffffffff, "\n"; # comment this line out if you receive the error
-
-
print 2**32, "\n"; # does this produce the same error?
-
$
$ perl test.pl
4294967295
4294967296
$
$ perl -v
This is perl, v5.8.4 built for sun4-solaris-64int
(with 31 registered patches, see perl -V for more detail)
this is from the keystore.pm -
####
-
# serial number
-
# extract hex certificate serial number (only required for -text format)
-
#$certinfo->{SerialNumber} =~ s/.*\(0x(.*)\)/$1/;
-
-
# store decimal serial number
-
$certinfo->{Serial} = hex($certinfo->{SerialNumber});
-
-
# pad with a leading zero if length is odd
-
if (length($certinfo->{SerialNumber}) % 2)
-
{
-
$certinfo->{SerialNumber} = '0' . $certinfo->{SerialNumber};
-
}
-
# convert to upcase and insert colons to separate hex bytes
-
$certinfo->{SerialNumber} = uc($certinfo->{SerialNumber});
-
$certinfo->{SerialNumber} =~ s/(..)/$1:/g;
-
$certinfo->{SerialNumber} =~ s/:$//;
-
-
####
-
RonB 589
Expert Mod 512MB
Prior to the hex( ) command, what is the actual value of:
$certinfo->{SerialNumber}
If you uncomment this line, I'm willing to bet that the error goes away.
#$certinfo->{SerialNumber} =~ s/.*\(0x(.*)\)/$1/;
However, that may not give you the final results that you expect.
RonB 589
Expert Mod 512MB
I think I found the issue. Your OS is 64 bit, but it appears that Perl was built for 32 bit.
You should be able to get around this, without recompiling Perl, by using Math::BigInt - use Math::BigInt;
-
-
$certinfo->{Serial} = Math::BigInt->new($certinfo->{SerialNumber})->as_hex;
-
Resource: http://www.perlmonks.org/?node_id=616866
Am sorry, still getting the same error.
Also, had attached the Keystore module.
Please rename Keystore.txt to Keystore.pm.
Thanks
RonB 589
Expert Mod 512MB
We were posting about the same time, so you may have missed my last comment.
Try using Math::BigInt
RonB 589
Expert Mod 512MB
Hey many thanks,
Am not getting this error any more.
Thanks again.
bprabhu17, you need to please start using code tags when you are posting code in the forums. They are required around any code you post, that way we don't have to clean up behind you.
Regards,
Jeff
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Todd |
last post by:
Our ASP.NET (C#) application accepts form entry and saves
inputed data in XML.
We are finding that users are sometimes cutting and
pasting special characters (from MS Word) into these
forms....
|
by: pavithra.eswaran |
last post by:
Hi,
I would like to convert a single precision hexadecimal number to
floating point. The following program seems to work fine..
But I do not want to use scanf. I already have a 32 bit hexadecimal...
|
by: akash deep batra |
last post by:
hi
i want to convert a 96 bit binary number into a hexadecimal number.
e.g binary number= 001100010001010000100101011110111111010101110100010110000101011000101010000000000000000000000000
how...
|
by: jaks.maths |
last post by:
How to convert negative integer to hexadecimal or octal number?
Ex: -568
What is the equivalent hexadecimal and octal number??
|
by: Vijay |
last post by:
Hi ,
I am doing a small project in c.
I have a Hexadecimal file and want to convert into ascii value.
(i.e., Hexadecimal to Ascii conversion from a file).
Could anyone help me?
Thanks in...
|
by: dharmdeep |
last post by:
Hi friends,
I need a sample code in C which will convert a Hexadecimal
number into decimal number. I had written a code for that but it was
too long, I need a small code, so request u all to...
|
by: elliotng.ee |
last post by:
I have a text file that contains a header 32-bit binary. For example,
the text file could be:
%%This is the input text
%%test.txt
Date: Tue Dec 26 14:03:35 2006...
|
by: Andrea |
last post by:
Hi,
suppose that I have a string that is an hexadecimal number, in order
to print this string I have to do:
void print_hex(unsigned char *bs, unsigned int n){
int i;
for (i=0;i<n;i++){...
|
by: sweeet_addiction16 |
last post by:
hello
Im writin a code in c...
can sum1 pls help me out in writing a c code to convert decimalnumber
to hexadecimal number.The hexadecimal number generated has to be an
unsigned long.
|
by: Ellipsis |
last post by:
Ok so I am converting to hexadecimal from decimal and I can only cout the reverse order of the hexadecimal?! How could I reverse this so its the right order? Heres my code:
#include <iostream>...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |