From 4d118956515aa55f6ca404183b7931faba7e0515 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 8 Apr 2020 09:42:34 -0500 Subject: [PATCH] patchinstall.py: Escape characters in C strings. --- staging/patchinstall.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/staging/patchinstall.py b/staging/patchinstall.py index b8ae9bd5..1eb01efc 100755 --- a/staging/patchinstall.py +++ b/staging/patchinstall.py @@ -124,8 +124,8 @@ def add_patch_data(patch): subject = line[9:] if '[' in subject: subject = subject[subject.index(']') + 1:] if author and subject: break - author = author.strip().strip('"') - subject = subject.strip() + author = author.strip().strip('"').replace('\\','\\\\').replace('"','\\"') + subject = subject.strip().replace('\\','\\\\').replace('"','\\"') patch_data += '+ {"%s", "%s", 1},\n' %(author, subject) def apply_set(patchlist, name):