Bug 9065 - source3/registry/regfio.c: bad call to memcpy
Summary: source3/registry/regfio.c: bad call to memcpy
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.6
Classification: Unclassified
Component: Client Tools (show other bugs)
Version: 3.6.6
Hardware: All All
: P5 normal
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-24 20:10 UTC by David Binderman
Modified: 2012-09-24 03:39 UTC (History)
0 users

See Also:


Attachments
git-am fix for 3.6.next. (942 bytes, patch)
2012-07-24 22:52 UTC, Jeremy Allison
ira: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2012-07-24 20:10:19 UTC
I just ran the static analysis checker cppcheck over the source
code of samba-3.6.6

It said

[samba-3.6.6/source3/registry/regfio.c:1470]: (warning) Using sizeof with a numeric constant as function argument might not be what you intended.

The source code is

    memcpy( hbin->header, "hbin", sizeof(HBIN_HDR_SIZE) );

I think you might be better off with

    memcpy( hbin->header, "hbin", HBIN_HDR_SIZE);
Comment 1 Jeremy Allison 2012-07-24 22:52:51 UTC
Created attachment 7719 [details]
git-am fix for 3.6.next.

Obvious goodness...
Comment 2 Jeremy Allison 2012-08-03 22:47:50 UTC
Comment on attachment 7719 [details]
git-am fix for 3.6.next.

Ping. Can I get someone to +1 this please. It's a pretty obvious fix that's already in master.
Comment 3 Ira Cooper 2012-08-03 23:16:20 UTC
Comment on attachment 7719 [details]
git-am fix for 3.6.next.

Go for it.. This is clearly right.
Comment 4 Jeremy Allison 2012-08-04 00:03:46 UTC
Re-assigning to Karolin for inclusion in 3.6.next. Thanks Ira !
Jeremy.
Comment 5 Karolin Seeger 2012-08-13 05:23:17 UTC
Pushed to v3-6-test.
Will be included in the next bugfix release.
Closing out bug report.

Thanks a lot!