include/rtl/ustring.hxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit c6431ba1d041379c37292337337690c01f144fe2
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Wed Mar 29 13:30:20 2023 +0000
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Wed Mar 29 18:06:38 2023 +0000

    Prevent accidental OUString(nullptr)
    
    Similar to commit f20162304d73bc01955e9ef6506c3bd1c7016c48
    (Rule out OString(std::nullptr_t), 2015-07-12); after that,
    OUString was changed to have only one ctor taking pointer
    in LIBO_INTERNAL_ONLY case, so became a similar issue.
    
    Change-Id: Iac851d1c24c0616ee52a112b81ba71877c28c493
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149696
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index c3966ac15cab..ddc0b5d2c0b2 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -252,6 +252,13 @@ public:
         rtl_uString_acquire( pData );
     }
 
+#if defined LIBO_INTERNAL_ONLY
+    /// @cond INTERNAL
+    // Catch inadvertent conversions to the above ctor:
+    OUString(std::nullptr_t) = delete;
+    /// @endcond
+#endif
+
     /** New OUString from OUString data without acquiring it.  Takeover of 
ownership.
 
         The SAL_NO_ACQUIRE dummy parameter is only there to distinguish this

Reply via email to