]> granicus.if.org Git - transmission/commitdiff
#6064: Add test cases which exhibit the issue
authorMike Gelfand <mikedld@mikedld.com>
Sat, 6 Feb 2016 22:23:36 +0000 (22:23 +0000)
committerMike Gelfand <mikedld@mikedld.com>
Sat, 6 Feb 2016 22:23:36 +0000 (22:23 +0000)
libtransmission/utils-test.c

index 2d05c79e1a591f6bb74d5ebb76c56772fd066a2c..af1d562984bab199517a776772db0cfb820a4d35 100644 (file)
@@ -130,6 +130,20 @@ test_utf8 (void)
   check_streq (in, out);
   tr_free (out);
 
+  in = "\xF4\x00\x81\x82";
+  out = tr_utf8clean (in, 4);
+  check (out != NULL);
+  check_streq ("?", out);
+  check (tr_utf8_validate (out, TR_BAD_SIZE, NULL));
+  tr_free (out);
+
+  in = "\xF4\x33\x81\x82";
+  out = tr_utf8clean (in, 4);
+  check (out != NULL);
+  check_streq ("?3??", out);
+  check (tr_utf8_validate (out, TR_BAD_SIZE, NULL));
+  tr_free (out);
+
   return 0;
 }