summaryrefslogtreecommitdiff
path: root/community/clamz/unencrypted-amz.patch
blob: 49b03ba8a1fdc2891e78ce25c6fc2dc66e9b9352 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--- playlist.c	2010-04-19 16:01:59.000000000 -0700
+++ clamz-0.4/playlist.c	2011-10-18 20:35:39.850146353 -0700
@@ -499,12 +499,21 @@
 {
   struct parseinfo pi;
   unsigned char *decrypted, *xml;
-  unsigned long decrypted_len;
+  unsigned long decrypted_len, i;
   int xerr;
 
   decrypted = decrypt_amz_file(b64data, b64len, fname);
-  if (!decrypted)
-    return 1;
+  if (!decrypted){
+    // XXX Perhaps the code file is unencrypted already.
+    decrypted = malloc((b64len + 1) * sizeof(char));
+    if (!decrypted) {
+      print_error("Out of memory");
+      return 1;
+    }
+    for (i = 0; i < b64len; i++) {
+      decrypted[i] = b64data[i]; 
+    }
+  }
   decrypted_len = strlen((char*) decrypted);
 
   pi.parser = XML_ParserCreate(NULL);