Bug 997185 - sendrecv.c example incorrect type for sockfd
sendrecv.c example incorrect type for sockfd
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: curl (Show other bugs)
Unspecified Unspecified
unspecified Severity low
: rc
: ---
Assigned To: Kamil Dudka
Stefan Kremen
Depends On:
  Show dependency treegraph
Reported: 2013-08-14 17:12 EDT by Leonard den Ottolander
Modified: 2015-07-22 01:42 EDT (History)
1 user (show)

See Also:
Fixed In Version: curl-7.19.7-43.el6
Doc Type: Bug Fix
Doc Text:
Previously, the code examples installed by the libcurl-devel package used a wrong data type for sockets when calling the curl_easy_getinfo() function. This resulted in stack smashing on some architectures because the API defines its own data type (of different size) for sockets. The examples have been fixed to use the correct data type for sockets, so the stack smashing no longer happens.
Story Points: ---
Clone Of:
Last Closed: 2015-07-22 01:42:55 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Leonard den Ottolander 2013-08-14 17:12:51 EDT
Description of problem:

The example /usr/share/doc/libcurl-devel-7.19.7/sendrecv.c uses a parameter sockfd of type int in the call to curl_easy_getinfo() where it should use a long. This causes a bufferoverflow that makes the binary fail if no optimization is used for its compilation.

Because the resulting binary seems to work correctly when optimization is used I mistakenly suspected gcc to be the cause of this issue (bug #996793).

The issue seems to be fixed upstream.

Version-Release number of selected component (if applicable):

Comment 1 Kamil Dudka 2013-08-15 08:30:34 EDT
upstream commit:

Comment 10 errata-xmlrpc 2015-07-22 01:42:55 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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