Issue 44 in google-sparsehash: windows/port.cc:TmpFile returns a pointer to a local varaible

2 views
Skip to first unread message

codesite...@google.com

unread,
Oct 7, 2009, 5:16:24 PM10/7/09
to google-s...@googlegroups.com
Status: New
Owner: ----

New issue 44 by jrleek: windows/port.cc:TmpFile returns a pointer to a
local varaible
http://code.google.com/p/google-sparsehash/issues/detail?id=44

We found this bug with a static analysis tool. It's an easy fix. Line 55
of src/windows/port.cc has:

char tmppath_buffer[1024];

line 62 has:

return tmppath_buffer;

oops.

What version of the product are you using? On what operating system?

I found this in version 1.3, but it's still there in 1.5.2.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

codesite...@google.com

unread,
Oct 11, 2009, 8:18:49 PM10/11/09
to google-s...@googlegroups.com
Updates:
Status: WontFix
Labels: Type-Defect Priority-Medium

Comment #1 on issue 44 by csilvers: windows/port.cc:TmpFile returns a

This is actually fine -- the function returns a string, not a pointer, so
the local
buffer is converted to a string before being returned.

I'm closing this as NotABug. Though maybe it's a good bug to file with the
static
analysis tool? :-)

Reply all
Reply to author
Forward
0 new messages