You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2021/10/29 19:41:16 UTC

[qpid-proton] 02/04: PROTON-2444: Fix potential use of uninitialised value

This is an automated email from the ASF dual-hosted git repository.

astitcher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git

commit 3d6c8c4d21070af86c8c130e119257cfdc30e6fe
Author: Andrew Stitcher <as...@apache.org>
AuthorDate: Wed Oct 27 17:56:16 2021 -0400

    PROTON-2444: Fix potential use of uninitialised value
---
 c/src/core/util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/c/src/core/util.c b/c/src/core/util.c
index bed2a54..70a3fe6 100644
--- a/c/src/core/util.c
+++ b/c/src/core/util.c
@@ -98,7 +98,7 @@ int pn_strcasecmp(const char *a, const char *b)
 int pn_strncasecmp(const char* a, const char* b, size_t len)
 {
   int diff = 0;
-  while (*b && len > 0) {
+  while (len > 0 && *b) {
     char aa = *a++, bb = *b++;
     diff = tolower(aa)-tolower(bb);
     if ( diff!=0 ) return diff;

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org