From 505883f042c0fbf9340dc1373c75bcde464d1f39 Mon Sep 17 00:00:00 2001 From: Marek Sokolowski Date: Tue, 29 Aug 2017 20:03:18 +0000 Subject: [PATCH] [llvm-rc] Fix DIALOG(EX) parsing ability (parser, pt 5/8). This fixes a use-after-free bug that was noticed by a sanitizer buildbot (http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/7502). Differential Revision: https://reviews.llvm.org/D37271 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312028 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-rc/ResourceScriptParser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/llvm-rc/ResourceScriptParser.cpp b/tools/llvm-rc/ResourceScriptParser.cpp index 499d0af83ad..41b11911b06 100644 --- a/tools/llvm-rc/ResourceScriptParser.cpp +++ b/tools/llvm-rc/ResourceScriptParser.cpp @@ -329,7 +329,7 @@ Expected RCParser::parseControl() { // [class] id, x, y, width, height [, style] [, exstyle] [, helpID] // Note that control ids must be integers. ASSIGN_OR_RETURN(ClassResult, readIdentifier()); - StringRef ClassUpper = ClassResult->upper(); + std::string ClassUpper = ClassResult->upper(); if (Control::SupportedCtls.find(ClassUpper) == Control::SupportedCtls.end()) return getExpectedError("control type, END or '}'", true); -- 2.50.1