Explorar o código

Bug 691422 - SetUnicodeStringFromUTF_8 - fix coverity control flow issues

https://bugzilla.redhat.com/show_bug.cgi?id=691422
Resolves: bug 691422
Bug Description: SetUnicodeStringFromUTF_8 - fix coverity control flow issues
Reviewed by: nkinder (Thanks!)
Branch: master
Fix Description: n is size_t, which is unsigned.  In this case, n cannot be less
than zero anyway, so comparison with 0 will suffice.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
Rich Megginson %!s(int64=14) %!d(string=hai) anos
pai
achega
be6ee97e7e
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      ldap/servers/plugins/collation/collate.c

+ 1 - 1
ldap/servers/plugins/collation/collate.c

@@ -278,7 +278,7 @@ SetUnicodeStringFromUTF_8 (UChar** U, int32_t* Ulen, int *isAlloced, const struc
     }	
 
     /* end now points at last non-null/non-space of val */
-    if (n < 0) { /* bogus */
+    if (n == 0) { /* bogus */
 	return U_INVALID_FORMAT_ERROR; /* don't know what else to use here */
     }