Closed Bug 229297 Opened 21 years ago Closed 21 years ago

lib/crmf/crmfdec.c: conversion from 'double ' to 'long ', possible loss of data

Categories

(NSS :: Libraries, defect, P3)

x86
Windows XP
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: wtc, Assigned: wtc)

Details

Attachments

(1 file)

When compiling lib/crmf/crmfdec.c, MSVC issues the
following warning:

cl -FoWIN954.0_DBG.OBJ/crmfdec.obj -c -Od -Z7 -MD -W3 -nologo -DXP_PC -DDEBUG -D
_DEBUG -UNDEBUG -DDEBUG_wtc -DWIN32 -D_WINDOWS -D_X86_ -DWIN95 -I../../../../dis
t/WIN954.0_DBG.OBJ/include  -I../../../../dist/public/nss -I../../../../dist/pri
vate/nss  G:/nss-tip/mozilla/security/nss/lib/crmf/crmfdec.c
crmfdec.c
G:/nss-tip/mozilla/security/nss/lib/crmf/crmfdec.c(349) : warning C4244: '=' : c
onversion from 'double ' to 'long ', possible loss of data
Attached patch Proposed patchSplinter Review
Use the equivalent integer arithmetic.
Attachment #137899 - Flags: superreview?(jpierre)
Attachment #137899 - Flags: review?(rrelyea0264)
Comment on attachment 137899 [details] [diff] [review]
Proposed patch

This patch fixes the compiler warning and is equivalent to the old code. I'm
not sure if the guesstimate is the correct thing to do, but I don't know too
much about CRMF requests size.
Attachment #137899 - Flags: superreview?(jpierre) → superreview+
Comment on attachment 137899 [details] [diff] [review]
Proposed patch

A quick look indicates that we should also increase arenaSize by sizeof(
CRMFCertReqMessages).

This isn't an issue since arenaSize is the arena page size, If the value is to
small, the code still functions, only more slowly.
Attachment #137899 - Flags: review?(rrelyea0264) → review+
Patch checked into the trunk.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.10
Setting priorities on unprioritized bugs resolved fixed for NSS 3.10.
Setting this to P3, since it was motivated only as warning reduction.
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: