Bug 650119 - rexec gives error "can't allocate memory!" if you specify the -p parameter
Summary: rexec gives error "can't allocate memory!" if you specify the -p parameter
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: rsh
Version: 14
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Adam Tkac
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-05 09:34 UTC by Marcel van Groenigen
Modified: 2013-04-30 23:47 UTC (History)
2 users (show)

Fixed In Version: rsh-0.17-63.fc14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-11-16 23:16:35 UTC
Type: ---


Attachments (Terms of Use)

Description Marcel van Groenigen 2010-11-05 09:34:41 UTC
As soon as you run rexec using the -p param, the program crashes.

# ./rexec -p test -l test localhost ls
./rexec: can't allocate memory!

If I look in the source rexec.c on line 318 there is the following statement

        *passwd = malloc((char *)malloc((passlen+1)*sizeof(char)));

I dont know much about C, so I may have this completely wrong.
but here it allocates memory malloc((passlen+1)*sizeof(char)) and then take the pointer to that memory and use that pointer as a size to allocate more memory :)?
That line probably should be:

        *passwd = malloc((passlen+1)*sizeof(char)));

If I recompile after this change all looks OK, and rexec works great.
this problem seems to exist in fedora 13 and fedora 14

Comment 1 Fedora Update System 2010-11-08 12:25:26 UTC
rsh-0.17-63.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/rsh-0.17-63.fc14

Comment 2 Fedora Update System 2010-11-08 22:47:39 UTC
rsh-0.17-63.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update rsh'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/rsh-0.17-63.fc14

Comment 3 Fedora Update System 2010-11-16 23:16:31 UTC
rsh-0.17-63.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.


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