You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/04/16 12:52:08 UTC

[GitHub] [incubator-nuttx-apps] acassis opened a new pull request #183: nshlib/nsh_codeccmd.c: fix potential NULL dereference and check mallo…

acassis opened a new pull request #183: nshlib/nsh_codeccmd.c: fix potential NULL dereference and check mallo…
URL: https://github.com/apache/incubator-nuttx-apps/pull/183
 
 
   …c return values

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] patacongo commented on a change in pull request #183: nshlib/nsh_codeccmd.c: fix potential NULL dereference and check mallo…

Posted by GitBox <gi...@apache.org>.
patacongo commented on a change in pull request #183: nshlib/nsh_codeccmd.c: fix potential NULL dereference and check mallo…
URL: https://github.com/apache/incubator-nuttx-apps/pull/183#discussion_r409778427
 
 

 ##########
 File path: include/netutils/md5.h
 ##########
 @@ -74,24 +73,24 @@ extern "C"
  * Public Types
  ****************************************************************************/
 
-struct MD5Context
+struct md5_context_s
 {
   uint32_t buf[4];
   uint32_t bits[2];
   uint8_t in[64];
 };
 
-typedef struct MD5Context MD5_CTX;
+typedef struct md5_context_s MD5_CTX;
 
 Review comment:
   Hmm... there are other examples where upper case types are used for handles (after Microsoft conventions).  I suppose we should end that practice because it is non-compliant with the standard.
   
   But you don't have to do that.  I will merge this PR without changing MD5_CTX.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] patacongo merged pull request #183: nshlib/nsh_codeccmd.c: fix potential NULL dereference and check mallo…

Posted by GitBox <gi...@apache.org>.
patacongo merged pull request #183: nshlib/nsh_codeccmd.c: fix potential NULL dereference and check mallo…
URL: https://github.com/apache/incubator-nuttx-apps/pull/183
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] acassis commented on a change in pull request #183: nshlib/nsh_codeccmd.c: fix potential NULL dereference and check mallo…

Posted by GitBox <gi...@apache.org>.
acassis commented on a change in pull request #183: nshlib/nsh_codeccmd.c: fix potential NULL dereference and check mallo…
URL: https://github.com/apache/incubator-nuttx-apps/pull/183#discussion_r409912635
 
 

 ##########
 File path: include/netutils/md5.h
 ##########
 @@ -10,7 +10,6 @@
  *
  *   This code implements the MD5 message-digest algorithm.
  *   The algorithm is due to Ron Rivest.  This code was
- *   written by Colin Plumb in 1993, no copyright is claimed.
 
 Review comment:
   No, I didn't want to remove it and also the above line will become incomplete if it was removed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] patacongo commented on a change in pull request #183: nshlib/nsh_codeccmd.c: fix potential NULL dereference and check mallo…

Posted by GitBox <gi...@apache.org>.
patacongo commented on a change in pull request #183: nshlib/nsh_codeccmd.c: fix potential NULL dereference and check mallo…
URL: https://github.com/apache/incubator-nuttx-apps/pull/183#discussion_r409563357
 
 

 ##########
 File path: include/netutils/md5.h
 ##########
 @@ -74,24 +73,24 @@ extern "C"
  * Public Types
  ****************************************************************************/
 
-struct MD5Context
+struct md5_context_s
 {
   uint32_t buf[4];
   uint32_t bits[2];
   uint8_t in[64];
 };
 
-typedef struct MD5Context MD5_CTX;
+typedef struct md5_context_s MD5_CTX;
 
 Review comment:
   The coding standard does not permit upper case letters in type name.  Types must always end in _t.  The correct name would be md5_ctx_t

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] patacongo commented on a change in pull request #183: nshlib/nsh_codeccmd.c: fix potential NULL dereference and check mallo…

Posted by GitBox <gi...@apache.org>.
patacongo commented on a change in pull request #183: nshlib/nsh_codeccmd.c: fix potential NULL dereference and check mallo…
URL: https://github.com/apache/incubator-nuttx-apps/pull/183#discussion_r409778427
 
 

 ##########
 File path: include/netutils/md5.h
 ##########
 @@ -74,24 +73,24 @@ extern "C"
  * Public Types
  ****************************************************************************/
 
-struct MD5Context
+struct md5_context_s
 {
   uint32_t buf[4];
   uint32_t bits[2];
   uint8_t in[64];
 };
 
-typedef struct MD5Context MD5_CTX;
+typedef struct md5_context_s MD5_CTX;
 
 Review comment:
   Hmm... there are other examples where upper case types are used for handles (after Microsoft conventions).  I suppose we should end that practice because it is non-compliant with the standard.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] patacongo commented on a change in pull request #183: nshlib/nsh_codeccmd.c: fix potential NULL dereference and check mallo…

Posted by GitBox <gi...@apache.org>.
patacongo commented on a change in pull request #183: nshlib/nsh_codeccmd.c: fix potential NULL dereference and check mallo…
URL: https://github.com/apache/incubator-nuttx-apps/pull/183#discussion_r409562537
 
 

 ##########
 File path: netutils/codecs/md5.c
 ##########
 @@ -119,15 +119,15 @@ static void byteReverse(FAR unsigned char *buf, unsigned longs)
  ****************************************************************************/
 
 /****************************************************************************
- * Name: MD5Init
+ * Name: md5_init
  *
  * Description:
  *   Start MD5 accumulation.  Set bit count to 0 and buffer to mysterious
  *   initialization constants.
  *
  ****************************************************************************/
 
-void MD5Init(struct MD5Context *ctx)
+void md5_init(struct md5_context_s *ctx)
 
 Review comment:
   This is a global function.  This will need a corresponding change to the prototype in apps/include/netutils/md5.h

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] patacongo commented on a change in pull request #183: nshlib/nsh_codeccmd.c: fix potential NULL dereference and check mallo…

Posted by GitBox <gi...@apache.org>.
patacongo commented on a change in pull request #183: nshlib/nsh_codeccmd.c: fix potential NULL dereference and check mallo…
URL: https://github.com/apache/incubator-nuttx-apps/pull/183#discussion_r409562537
 
 

 ##########
 File path: netutils/codecs/md5.c
 ##########
 @@ -119,15 +119,15 @@ static void byteReverse(FAR unsigned char *buf, unsigned longs)
  ****************************************************************************/
 
 /****************************************************************************
- * Name: MD5Init
+ * Name: md5_init
  *
  * Description:
  *   Start MD5 accumulation.  Set bit count to 0 and buffer to mysterious
  *   initialization constants.
  *
  ****************************************************************************/
 
-void MD5Init(struct MD5Context *ctx)
+void md5_init(struct md5_context_s *ctx)
 
 Review comment:
   This is a global function.  This will need a corresponding change to the prototype in apps/include/netutils/md5.h

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] patacongo commented on a change in pull request #183: nshlib/nsh_codeccmd.c: fix potential NULL dereference and check mallo…

Posted by GitBox <gi...@apache.org>.
patacongo commented on a change in pull request #183: nshlib/nsh_codeccmd.c: fix potential NULL dereference and check mallo…
URL: https://github.com/apache/incubator-nuttx-apps/pull/183#discussion_r409560918
 
 

 ##########
 File path: include/netutils/md5.h
 ##########
 @@ -10,7 +10,6 @@
  *
  *   This code implements the MD5 message-digest algorithm.
  *   The algorithm is due to Ron Rivest.  This code was
- *   written by Colin Plumb in 1993, no copyright is claimed.
 
 Review comment:
   Did you intend to remove this line?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] acassis commented on a change in pull request #183: nshlib/nsh_codeccmd.c: fix potential NULL dereference and check mallo…

Posted by GitBox <gi...@apache.org>.
acassis commented on a change in pull request #183: nshlib/nsh_codeccmd.c: fix potential NULL dereference and check mallo…
URL: https://github.com/apache/incubator-nuttx-apps/pull/183#discussion_r409914371
 
 

 ##########
 File path: include/netutils/md5.h
 ##########
 @@ -74,24 +73,24 @@ extern "C"
  * Public Types
  ****************************************************************************/
 
-struct MD5Context
+struct md5_context_s
 {
   uint32_t buf[4];
   uint32_t bits[2];
   uint8_t in[64];
 };
 
-typedef struct MD5Context MD5_CTX;
+typedef struct md5_context_s MD5_CTX;
 
 Review comment:
   Ok, I will fix line 13 and keep line 83 since you agree to merge without changing MD5_CTX.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services