From: Oliver Kurth Date: Tue, 29 Jan 2019 22:03:19 +0000 (-0800) Subject: CONSTANT_EXPRESSION_RESULT in TimeUtil_StringToDate(). X-Git-Tag: stable-10.3.10~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfa5e5d27a8a96a9c71fbe581f3fe32dcd2e55fd;p=thirdparty%2Fopen-vm-tools.git 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 9d72563aa..ddd66680c 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; }