diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-07-20 10:02:08 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-07-20 17:02:59 +0000 |
commit | 170def95113b0cc21fdfc7dc1182fd01b4910832 (patch) | |
tree | aeed84565bd114bdf88574ce308aa5b9f32718a7 /epan/dissectors/packet-dtls.c | |
parent | 09ae055f231ccd5513bde402ad988c49c017a957 (diff) | |
download | wireshark-170def95113b0cc21fdfc7dc1182fd01b4910832.tar.gz |
Fix escaping of strings in UATs.
Not only must characters that aren't printable ASCII characters be
escaped, backslashes must be escaped (as backslash is an escape
introducer) and double-quotes must be escaped (as double-quotes
encapsulate strings).
When constructing a string to hand to uat_load_str(), escape pathnames,
as they are likely to contain backslashes on Windows, could contain
backslashes on UN*X, and could contain quotes on UN*X and possibly
Windows. (Arguably, we should escape all the string arguments
Bug: 11372
Change-Id: I594840327fa41895130903c3c612ba97d6c29df3
Reviewed-on: https://code.wireshark.org/review/9716
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-dtls.c')
-rw-r--r-- | epan/dissectors/packet-dtls.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/epan/dissectors/packet-dtls.c b/epan/dissectors/packet-dtls.c index d2ce36a0d8..2748aa4a97 100644 --- a/epan/dissectors/packet-dtls.c +++ b/epan/dissectors/packet-dtls.c @@ -257,8 +257,10 @@ dtls_parse_old_keys(void) for (i = 0; old_keys[i] != NULL; i++) { parts = wmem_strsplit(NULL, old_keys[i], ",", 4); if (parts[0] && parts[1] && parts[2] && parts[3]) { + gchar *path = uat_esc(parts[3], (guint)strlen(parts[3])); uat_entry = wmem_strdup_printf(NULL, "\"%s\",\"%s\",\"%s\",\"%s\",\"\"", - parts[0], parts[1], parts[2], parts[3]); + parts[0], parts[1], parts[2], path); + g_free(path); if (!uat_load_str(dtlsdecrypt_uat, uat_entry, &err)) { ssl_debug_printf("dtls_parse: Can't load UAT string %s: %s\n", uat_entry, err); |