From: Oliver Kurth Date: Wed, 16 Jan 2019 22:53:05 +0000 (-0800) Subject: Fix CONSTANT_EXPRESSION_RESULT in TimeUtil_StringToDate(). X-Git-Tag: stable-11.0.0~246 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f16f911678e8075ba8422de3f2b70de9a7859974;p=thirdparty%2Fopen-vm-tools.git Fix CONSTANT_EXPRESSION_RESULT in TimeUtil_StringToDate(). Red Hat ran coverity scan on open-vm-tools and found an occurrence of CONSTANT_EXPRESSION_RESULT in TimeUtil_StringToDate(). --- diff --git a/open-vm-tools/lib/misc/timeutil.c b/open-vm-tools/lib/misc/timeutil.c index 856db875e..930ee268f 100644 --- a/open-vm-tools/lib/misc/timeutil.c +++ b/open-vm-tools/lib/misc/timeutil.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2018 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2019 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -152,8 +152,8 @@ TimeUtil_StringToDate(TimeUtil_Date *d, // IN/OUT: /* 'YYYY/MM/DD' */ char temp[16] = { 0 }; - if (!(((date[4] != '/') || (date[7] != '/')) || - ((date[4] != '-') || (date[7] != '-')))) { + if (!((date[4] == '/' && date[7] == '/') || + (date[4] == '-' && date[7] == '-'))) { return FALSE; }