diff options
author | cy <cy@FreeBSD.org> | 2015-07-05 15:42:16 +0000 |
---|---|---|
committer | cy <cy@FreeBSD.org> | 2015-07-05 15:42:16 +0000 |
commit | 4798ffa9e1d37998fdd0d94d9c2ad9cb3fb5d110 (patch) | |
tree | fb96356e3ef85aaa8d1f5939a9decd315a7ca596 /contrib/ntp/sntp/libopts/stack.c | |
parent | 8920bf0c56d10d9413aa5f7595886836b12c974f (diff) | |
parent | 5ef283fde5be3bb35376b46b0d8cdc0e6dff0ad4 (diff) | |
download | FreeBSD-src-4798ffa9e1d37998fdd0d94d9c2ad9cb3fb5d110.zip FreeBSD-src-4798ffa9e1d37998fdd0d94d9c2ad9cb3fb5d110.tar.gz |
MFV ntp-4.2.8p3 (r284990).
Approved by: roberto, delphij
Security: VuXML: 0d0f3050-1f69-11e5-9ba9-d050996490d0
Security: http://bugs.ntp.org/show_bug.cgi?id=2853
Security: https://www.kb.cert.org/vuls/id/668167
Security: http://support.ntp.org/bin/view/Main/SecurityNotice#June_2015_NTP_Security_Vulnerabi
Diffstat (limited to 'contrib/ntp/sntp/libopts/stack.c')
-rw-r--r-- | contrib/ntp/sntp/libopts/stack.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/contrib/ntp/sntp/libopts/stack.c b/contrib/ntp/sntp/libopts/stack.c index d2ce165..affe6b6 100644 --- a/contrib/ntp/sntp/libopts/stack.c +++ b/contrib/ntp/sntp/libopts/stack.c @@ -11,7 +11,7 @@ /* * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control @@ -38,8 +38,8 @@ * private: * * what: Remove option args from a stack - * arg: + tOptions* + opts + program options descriptor + - * arg: + tOptDesc* + od + the descriptor for this arg + + * arg: + tOptions * + opts + program options descriptor + + * arg: + tOptDesc * + od + the descriptor for this arg + * * doc: * Invoked for options that are equivalenced to stacked options. @@ -52,7 +52,7 @@ optionUnstackArg(tOptions * opts, tOptDesc * od) if (INQUERY_CALL(opts, od)) return; - arg_list = (tArgList*)od->optCookie; + arg_list = (tArgList *)od->optCookie; /* * IF we don't have any stacked options, @@ -165,7 +165,7 @@ optionUnstackArg(tOptions * opts, tOptDesc * od) od->fOptState &= OPTST_PERSISTENT_MASK; if ((od->fOptState & OPTST_INITENABLED) == 0) od->fOptState |= OPTST_DISABLED; - AGFREE((void *)arg_list); + AGFREE(arg_list); od->optCookie = NULL; } } @@ -179,19 +179,19 @@ optionUnstackArg(tOptions * opts, tOptDesc * od) LOCAL void addArgListEntry(void ** ppAL, void * entry) { - tArgList* pAL = *(void**)ppAL; + tArgList * pAL = *(void **)ppAL; /* * IF we have never allocated one of these, * THEN allocate one now */ if (pAL == NULL) { - pAL = (tArgList*)AGALOC(sizeof(*pAL), "new option arg stack"); + pAL = (tArgList *)AGALOC(sizeof(*pAL), "new option arg stack"); if (pAL == NULL) return; pAL->useCt = 0; pAL->allocCt = MIN_ARG_ALLOC_CT; - *ppAL = (void*)pAL; + *ppAL = VOIDP(pAL); } /* @@ -206,11 +206,11 @@ addArgListEntry(void ** ppAL, void * entry) * The base structure contains space for MIN_ARG_ALLOC_CT * pointers. We subtract it off to find our augment size. */ - sz += sizeof(char*) * ((size_t)pAL->allocCt - MIN_ARG_ALLOC_CT); - pAL = (tArgList*)AGREALOC((void*)pAL, sz, "expanded opt arg stack"); + sz += sizeof(char *) * ((size_t)pAL->allocCt - MIN_ARG_ALLOC_CT); + pAL = (tArgList *)AGREALOC(VOIDP(pAL), sz, "expanded opt arg stack"); if (pAL == NULL) return; - *ppAL = (void*)pAL; + *ppAL = VOIDP(pAL); } /* @@ -224,8 +224,8 @@ addArgListEntry(void ** ppAL, void * entry) * private: * * what: put option args on a stack - * arg: + tOptions* + opts + program options descriptor + - * arg: + tOptDesc* + od + the descriptor for this arg + + * arg: + tOptions * + opts + program options descriptor + + * arg: + tOptDesc * + od + the descriptor for this arg + * * doc: * Keep an entry-ordered list of option arguments. @@ -239,7 +239,7 @@ optionStackArg(tOptions * opts, tOptDesc * od) return; if ((od->fOptState & OPTST_RESET) != 0) { - tArgList * arg_list = (void*)od->optCookie; + tArgList * arg_list = od->optCookie; int ix; if (arg_list == NULL) return; @@ -254,7 +254,7 @@ optionStackArg(tOptions * opts, tOptDesc * od) return; AGDUPSTR(pz, od->optArg.argString, "stack arg"); - addArgListEntry(&(od->optCookie), (void*)pz); + addArgListEntry(&(od->optCookie), VOIDP(pz)); } } /** @} |