Bug 227503 - valgrind warning in libsmbclient
valgrind warning in libsmbclient
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: samba (Show other bugs)
6
All Linux
medium Severity medium
: ---
: ---
Assigned To: Simo Sorce
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-02-06 09:40 EST by Alexander Larsson
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-09-12 10:54:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Alexander Larsson 2007-02-06 09:40:58 EST
I get an uninitialized memory warning in:
samba-3.0.23c/source/libsmb/libsmbclient.c
when reading from smb:///.

The problem is this code:
		strncpy(server, context->workgroup, 
			((strlen(context->workgroup) < 16)
                         ? strlen(context->workgroup)
                         : 16));
                server[server_len - 1] = '\0';

Limiting the strncpy to strlen(source) means the terminating zero won't be copied.
Comment 1 Simo Sorce 2007-02-08 10:20:15 EST
Fixed upstream in rev 21239

Note You need to log in before you can comment on or make changes to this bug.