The Samba-Bugzilla – Attachment 16513 Details for
Bug 14658
string_sub_talloc can easily crash; use talloc_string_sub instead
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proof of abort
0001-crash-string_sub_talloc.patch (text/plain), 1.51 KB, created by
Douglas Bagnall
on 2021-03-10 01:53:06 UTC
(
hide
)
Description:
proof of abort
Filename:
MIME Type:
Creator:
Douglas Bagnall
Created:
2021-03-10 01:53:06 UTC
Size:
1.51 KB
patch
obsolete
>From b1d949bfe1082364e71af01fcbbbfda4ec605d88 Mon Sep 17 00:00:00 2001 >From: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> >Date: Wed, 10 Mar 2021 14:23:24 +1300 >Subject: [PATCH] crash string_sub_talloc() > >Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> >--- > lib/util/tests/string_sub_talloc.c | 11 +++++++++++ > lib/util/wscript_build | 6 ++++++ > 2 files changed, 17 insertions(+) > create mode 100644 lib/util/tests/string_sub_talloc.c > >diff --git a/lib/util/tests/string_sub_talloc.c b/lib/util/tests/string_sub_talloc.c >new file mode 100644 >index 00000000000..93810ee4923 >--- /dev/null >+++ b/lib/util/tests/string_sub_talloc.c >@@ -0,0 +1,11 @@ >+#include "includes.h" >+ >+int main(int argc, char *argv[]) >+{ >+ const char *s = "\255\255\255\255\255\255\255\255"; >+ const char *pattern = "\255\255\255\255"; >+ const char *insert = ""; >+ char *t = string_sub_talloc(NULL, s, pattern, insert); >+ printf("%s\n", t); >+ return 0; >+} >diff --git a/lib/util/wscript_build b/lib/util/wscript_build >index 460661e9a63..b6bfa203444 100644 >--- a/lib/util/wscript_build >+++ b/lib/util/wscript_build >@@ -356,3 +356,9 @@ else: > deps='cmocka replace talloc samba-util', > local_include=False, > for_selftest=True) >+ >+ bld.SAMBA_BINARY('test_string_sub_talloc', >+ source='tests/string_sub_talloc.c', >+ deps='replace talloc samba-util', >+ local_include=False, >+ for_selftest=True) >-- >2.25.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 14658
: 16513 |
16514