mirror of
https://github.com/dvorka/hstr.git
synced 2024-09-20 06:46:13 +08:00
Merge pull request #469 from juppytt/master
Heap buffer overflow in search fix (#467) and stack buffer overflow
This commit is contained in:
commit
79bc44a263
|
@ -1273,7 +1273,8 @@ void loop_to_select(void)
|
|||
pattern[0]=0;
|
||||
// TODO this is too late! > don't render twice
|
||||
// TODO overflow
|
||||
strcpy(pattern, hstr->cmdline);
|
||||
strncpy(pattern, hstr->cmdline, SELECTION_PREFIX_MAX_LNG-1);
|
||||
pattern[SELECTION_PREFIX_MAX_LNG-1]=0;
|
||||
|
||||
while (!done) {
|
||||
maxHistoryItems=recalculate_max_history_items();
|
||||
|
|
|
@ -114,7 +114,8 @@ char* parse_history_line(char *l)
|
|||
!isZsh ||
|
||||
#endif
|
||||
!l ||
|
||||
l[0]!=':') {
|
||||
l[0]!=':' ||
|
||||
l[1]!=' ') {
|
||||
return l;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue