C++에서 멤버의 접근성을 위반하는 연산

An Expression Violating the Member Accessibility in C++

  • 주성용 (동아대학교 컴퓨터공학과) ;
  • 조장우 (동아대학교 컴퓨터공학과)
  • 투고 : 2009.11.18
  • 심사 : 2010.01.06
  • 발행 : 2010.03.15

초록

본 논문에서는 기존 C++ 컴파일러에서 검출하지 못하는 클래스 멤버의 접근성을 위반하는 연산을 정의한다. C++에서는 접근 지정자로 클래스 멤버의 접근성을 선언하도록 하고 있다. 접근 지정자 중에서 private과 protected는 객체 외부에서 접근할 수 없는 멤버 지정을 위해서 사용된다. 그러나 C++ 의 포인터 연산을 이용하면 객체 외부에서 private이나 protected 접근성을 가지는 멤버로 직접 접근 가능하다. 본 논문에서는 멤버 접근성을 위반하는 연산의 원인과 사례를 보이고 이를 정형적으로 정의한다. 본 논문의 공헌은 기존에 다루어지지 않은 문제인 멤버의 접근성을 위반하는 연산을 정의하는 것이다.

This paper addresses a problem of violating the member accessibility of a class in C++, which is not detected as an error by existing C++ compilers. The member access specifiers can be used to specify member accessibility. The C++ uses a private or protected specifier for specifying the members which cannot be accessed from outside of an object. However, the private or protected members can be accessed from outside of that object by the pointer arithmetic in C++. We show some violating examples that cannot be detected by existing C++ compilers. The contribution of this paper is to discover and define the new problem of the member accessibility.

키워드

참고문헌

  1. Working Draft, Standard for Programming Language C++, http://www.openstd.org/jtc1/sc22/ wg21/, p.233.
  2. A. I. SOTIROV, Automatic vulnerability detection using static source code analysis; Final thesis Department of Computer Science in the Graduate School of University of Alabama, April 2007.
  3. Jeffrey S. Foster, M.Fahndrich, and A.Aiken, Flow-Insensitive Points-to Analysis with Term and Set Constraints, Technical Report UCB CSD- 97-964, U. of California, Berkeley, August 1997.
  4. Jeffrey S. Foster, Robert Johnsson, John Kodumal, and Alex Aiken, Flow-Insensitive Type Qualifiers, ACM Transactions on Programming Languages and Systems (TOPLAS), vol.28, no.6, 1035-1087, November 2006. https://doi.org/10.1145/1186632.1186635
  5. David Wagner, Jeffrey S. Foster, Eric A. Brewer, and Alexander Aiken, A First Step Towards Automated Detection of Buffer Overrun Vulnerabilities, Networking and Distributed System Security Symposium (NDSS), San Diego, California, February 2000.
  6. B. Steensgaard. Points-to analysis in alomost linear time, In Proceedings of the 23rd Annual ACM Symposium on Principles of Programming Languages, pp.32-41, 1996.
  7. M. Berndl, O. Lhotak, F. Qian, L. Hendren and N. Umanee, Points-to Analysis using BDDs, PLDI 2003, June 2003.