[Git][NTPsec/ntpsec][master] Revert "Address Coverity CID 161765: Integer handling issues (SIGN_EXTENSION)."

Gary E. Miller gitlab at mg.gitlab.com
Thu May 11 18:33:40 UTC 2017


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
fdd07a68 by Gary E. Miller at 2017-05-11T11:33:12-07:00
Revert "Address Coverity CID 161765: Integer handling issues (SIGN_EXTENSION)."

This reverts commit 0ecdf6820643cb9482c97ded9e0dc34e91f03668.

Bad patch, now these warnings are back:

../../libparse/binio.c: In function 'get_lsb_ulong':
../../libparse/binio.c:43:10: warning: conversion to 'long unsigned int' from 'int' may change the sign of the result [-Wsign-conversion]
   retval |= *((*bufpp)++) << 8;
          ^~
../../libparse/binio.c:44:10: warning: conversion to 'long unsigned int' from 'int' may change the sign of the result [-Wsign-conversion]
   retval |= *((*bufpp)++) << 16;
          ^~
../../libparse/binio.c:45:10: warning: conversion to 'long unsigned int' from 'int' may change the sign of the result [-Wsign-conversion]
   retval |= *((*bufpp)++) << 24;
          ^~

- - - - -


1 changed file:

- libparse/binio.c


Changes:

=====================================
libparse/binio.c
=====================================
--- a/libparse/binio.c
+++ b/libparse/binio.c
@@ -37,14 +37,14 @@ get_lsb_ulong(
 	unsigned char **bufpp
 	)
 {
-  unsigned long retval;
+  long retval;
 
   retval  = *((*bufpp)++);
   retval |= *((*bufpp)++) << 8;
   retval |= *((*bufpp)++) << 16;
   retval |= *((*bufpp)++) << 24;
 
-  return retval;
+  return (unsigned long)retval;
 }
 
 void



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/fdd07a68baf2ea75f86316f52908bee3e829368e

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/fdd07a68baf2ea75f86316f52908bee3e829368e
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170511/f1b478ba/attachment.html>


More information about the vc mailing list