| Submitter | Jim Meyering |
|---|---|
| Date | Oct. 4, 2012, 11:09 a.m. |
| Message ID | <1349349003-15672-12-git-send-email-jim@meyering.net> |
| Download | mbox | patch |
| Permalink | /patch/189252/ |
| State | New |
| Headers | show |
Comments
Patch
diff --git a/ui/vnc-auth-sasl.c b/ui/vnc-auth-sasl.c index 8fba770..bfdcb46 100644 --- a/ui/vnc-auth-sasl.c +++ b/ui/vnc-auth-sasl.c @@ -432,9 +432,7 @@ static int protocol_client_auth_sasl_start_len(VncState *vs, uint8_t *data, size static int protocol_client_auth_sasl_mechname(VncState *vs, uint8_t *data, size_t len) { - char *mechname = g_malloc(len + 1); - strncpy(mechname, (char*)data, len); - mechname[len] = '\0'; + char *mechname = g_strndup((const char *) data, len); VNC_DEBUG("Got client mechname '%s' check against '%s'\n", mechname, vs->sasl.mechlist);