From cc9bc8f824826a1b8a9326607a8cf34b10255d33 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 13 Feb 1995 16:17:03 +0000 Subject: [PATCH] null-terminate the error string in macstrerror --- Mac/Python/macglue.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Mac/Python/macglue.c b/Mac/Python/macglue.c index cbeeee71f4e..53f130f2735 100644 --- a/Mac/Python/macglue.c +++ b/Mac/Python/macglue.c @@ -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 {