Bugzilla – Attachment 63188 Details for
Bug 142954
xdm greeter - unhandled error case for malloc
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
Patch to catch realloc=>NULL and malloc=>NULL cases
verify.diff (text/plain), 987 bytes, created by
Jan Engelhardt
on 2006-01-12 21:46:30 UTC
(
hide
)
Description:
Patch to catch realloc=>NULL and malloc=>NULL cases
Filename:
MIME Type:
Creator:
Jan Engelhardt
Created:
2006-01-12 21:46:30 UTC
Size:
987 bytes
patch
obsolete
>diff -dpru xc~/programs/xdm/greeter/verify.c xc/programs/xdm/greeter/verify.c >--- xc~/programs/xdm/greeter/verify.c 2005-01-04 00:25:19.000000000 +0100 >+++ xc/programs/xdm/greeter/verify.c 2006-01-03 20:17:17.000000000 +0100 >@@ -145,16 +145,17 @@ static int PAM_conv (int num_msg, > case PAM_PROMPT_ECHO_OFF: > /* wants password */ > if (reply) { >- reply = realloc(reply, size); >+ if((reply = realloc(reply, size)) == NULL) { >+ free(reply); >+ return PAM_CONV_ERR; >+ } > bzero(reply + size - PAM_RESPONSE_SIZE, PAM_RESPONSE_SIZE); > } else { >- reply = (struct pam_response*)malloc(size); >+ if((reply = (struct pam_response*)malloc(size)) == NULL) >+ return PAM_CONV_ERR; > bzero(reply, size); > } > >- if (!reply) >- return PAM_CONV_ERR; >- > size += PAM_RESPONSE_SIZE; > > reply[replies].resp_retcode = PAM_SUCCESS;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 142954
: 63188