[Webkit-unassigned] [Bug 50048] New: Need to initialize destination variables before calling GL

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 24 18:14:33 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=50048

           Summary: Need to initialize destination variables before
                    calling GL
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: Mac OS X 10.5
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: WebGL
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: gman at google.com
                CC: kbr at google.com


Need to initialize variables before calling GL because if GL has lost the context then those variables will remain uninitialized.

For example

  GLsize len;
  glGetProgramiv(service_id_, GL_INFO_LOG_LENGTH, &len);
  char* dst = new char[len];

In the case above, if GL has lost the const, len will be uninitialized and quite possibly try to allocate a large amount of memory which may easily cause a crash. The solution is to always initialized the variables.

  GLsize len = 0;  <-----
  glGetProgramiv(service_id_, GL_INFO_LOG_LENGTH, &len);
  char* dst = new char[len];

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list