From bfa5e5d27a8a96a9c71fbe581f3fe32dcd2e55fd Mon Sep 17 00:00:00 2001 From: Oliver Kurth Date: Tue, 29 Jan 2019 14:03:19 -0800 Subject: [PATCH] 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(). --- open-vm-tools/lib/misc/timeutil.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; } -- 2.47.3