Staging
v0.5.1
https://github.com/python/cpython
Revision b2f3c2357c5bcc871cb3c789cae223faf0b472d1 authored by Serhiy Storchaka on 21 May 2015, 17:51:53 UTC, committed by Serhiy Storchaka on 21 May 2015, 17:51:53 UTC
2 parent s 041dd8e + 4faf5c5
Raw File
Tip revision: b2f3c2357c5bcc871cb3c789cae223faf0b472d1 authored by Serhiy Storchaka on 21 May 2015, 17:51:53 UTC
Issue #23985: Fixed integer overflow in iterator object. Patch by
Tip revision: b2f3c23
strdup.c
/* strdup() replacement (from stdwin, if you must know) */

#include "pgenheaders.h"

char *
strdup(const char *str)
{
	if (str != NULL) {
		char *copy = malloc(strlen(str) + 1);
		if (copy != NULL)
			return strcpy(copy, str);
	}
	return NULL;
}
back to top