@@ -1869,20 +1869,12 @@ struct commit_list **commit_list_append(struct commit *commit,
1869
1869
return & new_commit -> next ;
1870
1870
}
1871
1871
1872
- const char * find_header_mem (const char * msg , size_t len ,
1873
- const char * key , size_t * out_len )
1872
+ const char * find_commit_header (const char * msg , const char * key , size_t * out_len )
1874
1873
{
1875
1874
int key_len = strlen (key );
1876
1875
const char * line = msg ;
1877
1876
1878
- /*
1879
- * NEEDSWORK: It's possible for strchrnul() to scan beyond the range
1880
- * given by len. However, current callers are safe because they compute
1881
- * len by scanning a NUL-terminated block of memory starting at msg.
1882
- * Nonetheless, it would be better to ensure the function does not look
1883
- * at msg beyond the len provided by the caller.
1884
- */
1885
- while (line && line < msg + len ) {
1877
+ while (line ) {
1886
1878
const char * eol = strchrnul (line , '\n' );
1887
1879
1888
1880
if (line == eol )
@@ -1899,10 +1891,6 @@ const char *find_header_mem(const char *msg, size_t len,
1899
1891
return NULL ;
1900
1892
}
1901
1893
1902
- const char * find_commit_header (const char * msg , const char * key , size_t * out_len )
1903
- {
1904
- return find_header_mem (msg , strlen (msg ), key , out_len );
1905
- }
1906
1894
/*
1907
1895
* Inspect the given string and determine the true "end" of the log message, in
1908
1896
* order to find where to put a new Signed-off-by trailer. Ignored are
0 commit comments