|
|
Choosing A Webhost: |
[PATCH] environ array fix for VMS: msg#00022lang.perl.ports.vms
Due to passing the wrong length to strncmp, any key in %ENV whose beginning matched something in the C environ array would get conflated with it. In other words, $ENV{PATH} and $ENV{PATHOLOGICAL} would both be treated as $ENV{PATH}. The attached patch fixes this and is against bleadperl but relevant to 5.6 and later. Thanks to Greg Snow for the bug report. --- vms/vms.c_orig Sun Dec 7 15:36:04 2003 +++ vms/vms.c Thu Dec 11 10:21:13 2003 @@ -222,6 +222,7 @@ retsts = SS$_NOLOGNAM; for (i = 0; environ[i]; i++) { if ((eq = strchr(environ[i],'=')) && + lnmdsc.dsc$w_length == (eq - environ[i]) && !strncmp(environ[i],uplnm,eq - environ[i])) { eq++; for (eqvlen = 0; eq[eqvlen]; eqvlen++) eqv[eqvlen] = eq[eqvlen]; @@ -733,8 +734,9 @@ for (curtab = 0; tabvec[curtab]; curtab++) { if (!ivenv && !str$case_blind_compare(tabvec[curtab],&crtlenv)) { int i; - for (i = 0; environ[i]; i++) { /* Iff it's an environ elt, reset */ + for (i = 0; environ[i]; i++) { /* If it's an environ elt, reset */ if ((cp1 = strchr(environ[i],'=')) && + lnmdsc.dsc$w_length == (cp1 - environ[i]) && !strncmp(environ[i],lnm,cp1 - environ[i])) { #ifdef HAS_SETENV return setenv(lnm,"",1) ? vaxc$errno : 0;
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: Access violation from humongous "glob" call, PPrymmer |
|---|---|
| Next by Date: | Re: [PATCH] environ array fix for VMS, Rafael Garcia-Suarez |
| Previous by Thread: | [PATCH] setenv tweak for VMS, Craig A. Berry |
| Next by Thread: | Re: [PATCH] environ array fix for VMS, Rafael Garcia-Suarez |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |