Kaydet (Commit) ec498276 authored tarafından Guido van Rossum's avatar Guido van Rossum

fix strncpy call (uninitialized memory read)

üst badadd21
......@@ -168,7 +168,8 @@ parsetok(tok, g, start, err_ret)
int len = tok->inp - tok->buf;
err_ret->text = malloc(len + 1);
if (err_ret->text != NULL) {
strncpy(err_ret->text, tok->buf, len+1);
if (len > 0)
strncpy(err_ret->text, tok->buf, len);
err_ret->text[len] = '\0';
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment