[PATCH 11/12] bugfix: openssh-4.3p2 variable reuse bug

This is a discussion on [PATCH 11/12] bugfix: openssh-4.3p2 variable reuse bug within the OpenSSH Development forums, part of the Networking and Network Related category; Since the comment variable is used later in the function for other purposes. It is necessary to NULL the variable ...


Go Back   Usenet Forums > Networking and Network Related > OpenSSH Development

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-16-2006
Kylene Jo Hall
 
Posts: n/a
Default [PATCH 11/12] bugfix: openssh-4.3p2 variable reuse bug

Since the comment variable is used later in the function for other
purposes. It is necessary to NULL the variable so it can be
differentiated as a new allocation from the previous use remenants
(which have already been freed) to avoid using an already freed pointer
in the assignment comment = cp ? *cp : comment. When the code path is
such that comment has not been reset. This entire set of patches passed
the regression tests on my system. Bug found by Coverity.

Signed-off-by: Kylene Hall <kjhall@us.ibm.com>
---
ssh-keygen.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletion(-)

diff -uprN openssh-4.3p2/ssh-keygen.c openssh-4.3p2-kylie/ssh-keygen.c
--- openssh-4.3p2/ssh-keygen.c 2005-11-28 20:10:25.000000000 -0600
+++ openssh-4.3p2-kylie/ssh-keygen.c 2006-05-03 16:23:38.000000000 -0500
@@ -485,8 +485,10 @@ do_fingerprint(struct passwd *pw)
xfree(fp);
exit(0);
}
- if (comment)
+ if (comment) {
xfree(comment);
+ comment = NULL;
+ }

f = fopen(identity_file, "r");
if (f != NULL) {


_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
http://www.mindrot.org/mailman/listi...enssh-unix-dev
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:13 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0