Commit cc9bc8f8 authored by Guido van Rossum's avatar Guido van Rossum

null-terminate the error string in macstrerror

parent e6c884ca
......@@ -123,6 +123,7 @@ char *macstrerror(int err)
HLock(h);
str = (char *)*h;
memcpy(buf, str+1, (unsigned char)str[0]);
buf[(unsigned char)str[0]] = '\0';
HUnlock(h);
ReleaseResource(h);
} else {
......
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