On 3/17/2011 2:29 PM, Kelly O'Hair wrote:
Dan, It looks ok, but you are using sprintf, and it really should be snprintf. On Windows you may need to: #define snprintf _snprintf Yup. I know we have to do that someday soon... --- We (myself included) all need to start being more careful about use of strcpy, strcat, sprintf, etc. The static analysis tools are all starting to just flag the use of them as an error, so we need to start getting rid of these calls from all our code eventually. Which may take some major time. :^( I copied the code from elsewhere in src/windows/native/... just so I could do it like "everyone else"... Don't shoot the messenger. :^( No plans to shoot you. Would it be OK if I pushed this fix as is? When I continue with 7020052 (the related bug), I'll come back to this file and switch to snprintf()... along with the rest of the fix... Dan -ktoOn Mar 17, 2011, at 11:42 AM, Daniel D. Daugherty wrote:Greetings, I have minor fixes to the Attach On Demand (AOD) Windows specific code that I'd like to get into T&L snapshot for OpenJDK7-B136 (next week): http://cr.openjdk.java.net/~dcubed/7028668-webrev/0/ I'm adding more info to the default detail message for an OpenProcess() failure. I'm also getting a process handle in a different way when a Java process tries to attach to itself. If the new technique fails, then we fall back to the original OpenProcess() code. Thanks, in advance, for any comments. Dan |
- Re: code review for attach on demand (AOD) fix for Win... Alan Bateman
- Re: code review for attach on demand (AOD) fix fo... Alan Bateman
- Re: code review for attach on demand (AOD) fi... Daniel D. Daugherty
- Re: code review for attach on demand (AOD) fix fo... Daniel D. Daugherty
- Re: code review for attach on demand (AOD) fi... Daniel D. Daugherty
