File B0002-base64-use-strtok_r-instead-of-strtok-to-make-sure-were-thread-safe.patch of Package libplist.4095

From e9995aee384bdbac6c6afc0f4548a080eb4241bc Mon Sep 17 00:00:00 2001
From: Nikias Bassen <nikias@gmx.li>
Date: Wed, 9 Oct 2013 16:30:37 +0200
Subject: [PATCH] base64: use strtok_r instead of strtok to make sure we're
 thread safe

---
 src/base64.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/base64.c b/src/base64.c
index e558d9e..96d49f3 100644
--- a/src/base64.c
+++ b/src/base64.c
@@ -111,13 +111,14 @@ unsigned char *base64decode(const char *buf, size_t *size)
 
 	unsigned char *line;
 	int p = 0;
+	char* saveptr = NULL;
 
-	line = (unsigned char*)strtok((char*)buf, "\r\n\t ");
+	line = (unsigned char*)strtok_r((char*)buf, "\r\n\t ", &saveptr);
 	while (line) {
 		p+=base64decode_block(outbuf+p, (const char*)line, strlen((char*)line));
 
 		// get next line of base64 encoded block
-		line = (unsigned char*)strtok(NULL, "\r\n\t ");
+		line = (unsigned char*)strtok_r(NULL, "\r\n\t ", &saveptr);
 	}
 	outbuf[p] = 0;
 	*size = p;
openSUSE Build Service is sponsored by