Commit 040d2d49 authored by Guido van Rossum's avatar Guido van Rossum

Use getstringsize where available instead of strlen.

parent a42613d4
......@@ -550,7 +550,7 @@ instance_setattr(inst, name, v)
if (sname[0] == '_' && sname[1] == '_'
&& (strcmp(sname, "__dict__") == 0 ||
strcmp(sname, "__class__") == 0)) {
int n = strlen(sname);
int n = getstringsize(name);
if (sname[n-1] == '_' && sname[n-2] == '_') {
err_setstr(TypeError, "read-only special attribute");
return -1;
......
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