]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Add Coverity annotations.
authorOliver Kurth <okurth@vmware.com>
Tue, 27 Aug 2019 19:55:35 +0000 (12:55 -0700)
committerOliver Kurth <okurth@vmware.com>
Tue, 27 Aug 2019 19:55:35 +0000 (12:55 -0700)
Add source code annotations so that Coverity scans will automatically
classify certain issues as "intentional."  These annotations serve to
memorialize these classifications in open-vm-tools source, both for
internal reference as well as for partners like Red Hat who run their
own Coverity scans on open-vm-tools.

open-vm-tools/vgauth/lib/proto.c
open-vm-tools/vgauth/serviceImpl/proto.c

index 8d1c1c28a21dfc4884fe729005915c75c95c3a26..36bd76f168aa0b6646954ed8a1a3db49deb3fac8 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2012-2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2012-2017,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
@@ -1400,6 +1400,8 @@ VGAuth_SendConnectRequest(VGAuthContext *ctx)
    pid = Convert_UnsignedInt32ToText(dwPid);
 #endif
 
+   /* Value of pid is always NULL on non-Windows platforms */
+   /* coverity[dead_error_line] */
    packet = g_markup_printf_escaped(VGAUTH_CONNECT_REQUEST_FORMAT,
                                     ctx->comm.sequenceNumber,
                                     pid ? pid : "");
@@ -1806,6 +1808,8 @@ VGAuth_SendCreateTicketRequest(VGAuthContext *ctx,
       Convert_UnsignedInt32ToText((unsigned int)(size_t)userHandle->token);
 #endif
 
+   /* Value of tokenInText is always NULL on non-Windows platforms */
+   /* coverity[dead_error_line] */
    packet = g_markup_printf_escaped(VGAUTH_CREATETICKET_REQUEST_FORMAT_START,
                                     ctx->comm.sequenceNumber,
                                     userHandle->userName,
index f097fb65047ae8032bcb0dfbc6b59838b6a22cd3..b6e7b3f0348591b0033e829cd945d42e322d41b7 100644 (file)
@@ -1572,8 +1572,12 @@ ServiceProtoHandleConnection(ServiceConnection *conn,
 #endif
 
    if (err != VGAUTH_E_OK) {
+      /* Value of err is always VGAUTH_E_OK on non-Windows platforms */
+      /* coverity[dead_error_line] */
       packet = Proto_MakeErrorReply(conn, req, err, "connect failed");
    } else {
+      /* Value of event is always NULL on non-Windows platforms */
+      /* coverity[dead_error_line] */
       packet = g_markup_printf_escaped(VGAUTH_CONNECT_REPLY_FORMAT,
                                        req->sequenceNumber,
                                        event ? event : "");
@@ -1995,6 +1999,8 @@ ServiceProtoValidateTicket(ServiceConnection *conn,
    if (err != VGAUTH_E_OK) {
       packet = Proto_MakeErrorReply(conn, req, err, "validateTicket failed");
    } else {
+      /* Value of token is always NULL on non-Windows platforms */
+      /* coverity[dead_error_line] */
       packet = g_markup_printf_escaped(VGAUTH_VALIDATETICKET_REPLY_FORMAT_START,
                                        req->sequenceNumber,
                                        userName,
@@ -2165,6 +2171,8 @@ ServiceProtoValidateSamlBearerToken(ServiceConnection *conn,
                   SU_(validate.samlBearer.success,
                       "Validated SAML bearer token for user '%s'"),
                   userName);
+      /* Value of tokenStr is always NULL on non-Windows platforms */
+      /* coverity[dead_error_line] */
       packet = g_markup_printf_escaped(VGAUTH_VALIDATESAMLBEARERTOKEN_REPLY_FORMAT_START,
                                        req->sequenceNumber,
                                        userName ? userName : "",