Browse Source

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 14 years ago
parent
commit
be6ee97e7e
1 changed files with 1 additions and 1 deletions
  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 */
     }