Compile warning in OpenVRSession.cpp: the use of `tmpnam' is dangerous

RESOLVED FIXED in Firefox 68

Status

()

defect
RESOLVED FIXED
3 months ago
a month ago

People

(Reporter: TYLin, Assigned: daoshengmu)

Tracking

unspecified
mozilla68
Points:
---

Firefox Tracking Flags

(firefox68 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Reporter

Description

3 months ago

The following warnings are shown after linking libxul.so.

 0:09.42 toolkit/library/libxul.so
 0:28.59 /home/tlin/Projects/gecko/gfx/vr/service/OpenVRSession.cpp:285: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
 0:28.59 /home/tlin/Projects/gecko/gfx/vr/service/OpenVRSession.cpp:292: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
 0:28.59 /home/tlin/Projects/gecko/gfx/vr/service/OpenVRSession.cpp:324: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
 0:28.59 /home/tlin/Projects/gecko/gfx/vr/service/OpenVRSession.cpp:341: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
 0:28.59 /home/tlin/Projects/gecko/gfx/vr/service/OpenVRSession.cpp:352: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
 0:28.59 /home/tlin/Projects/gecko/gfx/vr/service/OpenVRSession.cpp:369: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
 0:38.59 toolkit/library/dependentlibs.list.stub

FWIW, I compile on Linux using clang version clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final), and the following in my mozconfig.

ac_add_options --enable-debug
ac_add_options --disable-optimize
Reporter

Comment 1

3 months ago

If it's intentional to use std::tmpnam(nullptr), maybe we should silence the warnings?

Assignee

Comment 2

3 months ago

Thanks, TYLin.

I think we should replace std::tmpnam with std::tmpnam_s. I will work on this shortly.

Assignee

Updated

3 months ago
Assignee: nobody → dmu
Assignee

Comment 4

3 months ago

we will target it to FF 68.

Duplicate of this bug: 1515850

daoshengmu, the patch does not have any reviewers. Do you consider it finished?

Flags: needinfo?(dmu)
Assignee

Comment 7

a month ago

(In reply to Frederik Braun [:freddyb] from comment #6)

daoshengmu, the patch does not have any reviewers. Do you consider it finished?

I haven't done it yet but close. I will continue to work on this this week.

Flags: needinfo?(dmu)
Assignee

Updated

a month ago
Attachment #9049043 - Attachment is obsolete: true

Comment 9

a month ago
Pushed by dmu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bb714fa13ef9
Replace tmpname in OpenVRSession when using action input. r=kip

Comment 10

a month ago
bugherder
Status: NEW → RESOLVED
Last Resolved: a month ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.