diff options
author | Guido van Rossum <guido@python.org> | 1998-06-15 18:01:34 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-06-15 18:01:34 (GMT) |
commit | 76ec53c64df498eebc08d5cf7e53d2fc01064384 (patch) | |
tree | 772d7f2002de5a64a160b4fef2194b45b49dc061 /PC/import_nt.c | |
parent | 60f2f0cf8e10c94693dfea8937b7feabeffe5744 (diff) | |
download | cpython-76ec53c64df498eebc08d5cf7e53d2fc01064384.zip cpython-76ec53c64df498eebc08d5cf7e53d2fc01064384.tar.gz cpython-76ec53c64df498eebc08d5cf7e53d2fc01064384.tar.bz2 |
Subject: Bug in PC/import_nt.c
From: Dan Pierson <dan@remote.control.com>
To: "Mark Hammond (E-mail)" <MHammond@skippinet.com.au>,
"Guido van Rossum (E-mail)" <guido@cnri.reston.va.us>
Date: Mon, 8 Jun 1998 17:25:07 -0400
RegistryQueryValue requires that its fourth argument be initialized to
the length of the buffer being passed in, this wasn't being done. I
also split the call and status test into two lines with a local variable
so that I could look at the status in the debugger.
Diffstat (limited to 'PC/import_nt.c')
-rw-r--r-- | PC/import_nt.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/PC/import_nt.c b/PC/import_nt.c index 1769697..b506694 100644 --- a/PC/import_nt.c +++ b/PC/import_nt.c @@ -45,6 +45,7 @@ FILE *PyWin_FindRegisteredModule( const char *moduleName, struct filedescr **ppF FILE *fp; HKEY keyBase = PyWin_IsWin32s() ? HKEY_CLASSES_ROOT : HKEY_LOCAL_MACHINE; int modNameSize; + long regStat; // Calculate the size for the sprintf buffer. // Get the size of the chars only, plus 1 NULL. @@ -53,7 +54,9 @@ FILE *PyWin_FindRegisteredModule( const char *moduleName, struct filedescr **ppF moduleKey = alloca(bufSize); sprintf(moduleKey, "Software\\Python\\PythonCore\\%s\\Modules\\%s%s", PyWin_DLLVersionString, moduleName, debugString); - if (RegQueryValue(keyBase, moduleKey, pathBuf, &modNameSize)!=ERROR_SUCCESS) + modNameSize = bufSize; + regStat = RegQueryValue(keyBase, moduleKey, pathBuf, &modNameSize); + if (regStat!=ERROR_SUCCESS) return NULL; // use the file extension to locate the type entry. for (fdp = _PyImport_Filetab; fdp->suffix != NULL; fdp++) { |