work around glibc bug: printf("%.*s", INT_MAX, s) tries to allocate 2G.
This commit is contained in:
		
							parent
							
								
									927feae988
								
							
						
					
					
						commit
						2e39fa9930
					
				
					 2 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -640,7 +640,7 @@ maildir_scan( maildir_store_t *ctx, msglist_t *msglist )
 | 
				
			||||||
				if (u)
 | 
									if (u)
 | 
				
			||||||
					ml = u - entry->base;
 | 
										ml = u - entry->base;
 | 
				
			||||||
				else
 | 
									else
 | 
				
			||||||
					ru = "", ml = INT_MAX;
 | 
										ru = "", ml = sizeof(buf);
 | 
				
			||||||
				fnl = nfsnprintf( buf + bl, sizeof(buf) - bl, "%s/%.*s,U=%d%s", subdirs[entry->recent], ml, entry->base, uid, ru ) + 1 - 4;
 | 
									fnl = nfsnprintf( buf + bl, sizeof(buf) - bl, "%s/%.*s,U=%d%s", subdirs[entry->recent], ml, entry->base, uid, ru ) + 1 - 4;
 | 
				
			||||||
				memcpy( nbuf, buf, bl + 4 );
 | 
									memcpy( nbuf, buf, bl + 4 );
 | 
				
			||||||
				nfsnprintf( nbuf + bl + 4, sizeof(nbuf) - bl - 4, "%s", entry->base );
 | 
									nfsnprintf( nbuf + bl + 4, sizeof(nbuf) - bl - 4, "%s", entry->base );
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -154,7 +154,7 @@ convert( const char *box, int altmap )
 | 
				
			||||||
			if (u)
 | 
								if (u)
 | 
				
			||||||
				ml = u - e->d_name;
 | 
									ml = u - e->d_name;
 | 
				
			||||||
			else
 | 
								else
 | 
				
			||||||
				ru = "", ml = INT_MAX;
 | 
									ru = "", ml = sizeof(buf);
 | 
				
			||||||
			if (altmap) {
 | 
								if (altmap) {
 | 
				
			||||||
				if (!p)
 | 
									if (!p)
 | 
				
			||||||
					continue;
 | 
										continue;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue