Permalink
Browse files

"Suspicious dereference of pointer 'ptm' before NULL check at line

858" (klocwork.com Issue #19)

git-svn-id: svn://cherokee-project.com/cherokee/trunk@6659 5dc97367-97f1-0310-9951-d761b3857238
  • Loading branch information...
1 parent 4eda0ad commit ae433f45ca412faeceab984c0614c17e86626aa0 @alobbs alobbs committed May 21, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 cherokee/dtm.c
View
@@ -853,13 +853,13 @@ cherokee_dtm_gmttm2str( char *bufstr, size_t bufsize, struct tm *ptm )
{
unsigned int uYear;
- uYear = (unsigned int) ptm->tm_year + 1900;
-
if ( ptm == NULL || bufsize < DTM_SIZE_GMTTM_STR ) {
bufstr[0] = '\0';
return 0;
}
+ uYear = (unsigned int) ptm->tm_year + 1900;
+
bufstr[ 0] = wday_name_tab[ ptm->tm_wday ].name1[0];
bufstr[ 1] = wday_name_tab[ ptm->tm_wday ].name1[1];
bufstr[ 2] = wday_name_tab[ ptm->tm_wday ].name1[2];

0 comments on commit ae433f4

Please sign in to comment.