Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cc9bc8f

Browse files
committed
null-terminate the error string in macstrerror
1 parent e6c884c commit cc9bc8f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Mac/Python/macglue.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ char *macstrerror(int err)
123123
HLock(h);
124124
str = (char *)*h;
125125
memcpy(buf, str+1, (unsigned char)str[0]);
126+
buf[(unsigned char)str[0]] = '\0';
126127
HUnlock(h);
127128
ReleaseResource(h);
128129
} else {

0 commit comments

Comments
 (0)